The servlet doesn’t even get registered (the @WebServlet annotation seems to be useless). So I tried defining the servlet in web.xml instead of using annotations. The servlet does now get registered (I can see it in getServletContext().getServletRegistrations()) but any requests to /app/example are still just getting redirected back to /app/, even when logged in to an existing session.
Is there any way to use a custom servlet like this?
In this case you have to use URL in the following form: http://domain:port/mydemo/ with the trailing slash since URLs without it are consumed by the Vaadin servlet mapped as /*.
Also I recommend to use Spring MVC Controllers instead of plain-old servlets. You can define them or setup component-scan in dispatcher-spring.xml file. All Spring MVC controllers are available under /dispatch/ path.
Hi I want to use servlet in my cuba application for SMS (long code) service integration(done).
We are sending a SMS to some number with some fixed unique code and that intern will we calling some url of our application.
we were trying with rest controller(custom) but SMS vendor is telling to use servlet because they will give the request in the form of POST request with HttpServletRequest request .
inorder to handle this I have created servlet mapping inside web.xml (portal module) as below