Simple Java Web framework based on Jersey, Netty, Logback and Gson.
It's actually just a Glue between these libraries - and apart from this, it's not much opinionated.
public class MyApp {
public static void main(string[] args) {
new Application()
.register(myresource.class)
.start();
}
}
You just need to create a new application, configure it/register your resources and start it.
If you want an OOP approach, you can extend the Application class and implement the initialize()
method, which is called before the application start.
There's also a destroy
method, called when the application is being stopped.
public class MyApp extends Application {
public void initialize() {
this.register(myresource.class);
this.db = new DB();
}
public void destroy() {
this.register(myresource.class);
this.db.close();
}
public static void main(string[] args) {
new MyApp().start();
}
}
See Application.java for more about how to get started.