Hello.
at this URL:
I found in the web.xml:
<!--
URL Pattern /_ah/api/* instead of /* because a legacy v1 servlet uses
the route /_ah/api/ and using /* will erronously use the legacy v1
servlet instead of routing to your API.
-->
<filter-mapping>
<filter-name>guiceFilter</filter-name>
<url-pattern>/_ah/api/*</url-pattern>
</filter-mapping>
I do not understand why if I put /* instead of /_ah/api/* then it does not work...
In fact I managed to make my endpoint work with guice: everything is working fine concerning the endpoint.
But now I want to add a cron task wich means I need to create a servelt and add it to my web.xml
the issue that I have it that in the servlet I want to use GUICE, but the DI does not work:
when I use this code, the "updater" that is supposed to have been injected is null...
public class UpdateCurrenciesServlet extends HttpServlet {
Logger logger = Logger.getLogger(this.getClass().getName());
@Inject
CurrencyRateUpdater updater;
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
try {
updater.doOnGae();
}
catch (InterruptedException | ExecutionException | TimeoutException e) {
logger.log(Level.SEVERE, e.toString(), e);
}
resp.setStatus(HttpStatusCodes.STATUS_CODE_OK);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
super.doPost(req, resp);
}
}
what am I missing?
thank you for the help