4 ms·
The demo code (now in subproject grumpyrest-demo) has a complete example. It works like this: public static class MyServlet extends RestServlet { public
by moring 3y ago
The demo code (now in subproject grumpyrest-demo) has a complete example. It works like this:
public static class MyServlet extends RestServlet {
public MyServlet() {
super(buildApi());
}
private static RestApi buildApi() {
RestApi api = new RestApi();
...
return api;
}
}
It's a bit annoying right now, but that's because the servlet is supposed to be constructed by the servlet container using a no-arg constructor. I hope I can improve this in the future.