4 ms·
Still not clear how one is supposed to wire this to the servlet container. You instantiate a RestApi object and then . . . . magic?
by caeril 3y ago
Still not clear how one is supposed to wire this to the servlet container.
You instantiate a RestApi object and then . . . . magic?
- moring 3y agoThe 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.