I have standard servlet-mapping for Dispatcher Servlet – /app/*. I have controller that handle /notify requests. I need to expose this controller as servlet on http://[SERVER]/notify. How to simple redirect all requests from http://[SERVER]/notify to http://[SERVER]/app/notify (but without other tools, like urlrewrite) ? I know i can write simple servlet instead of, and set servlet-mapping in web.xml, but want to have controller, not servlet 😉
<servlet-mapping>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>
Controller:
@Controller
public class PaymentNotificationController {
@RequestMapping("/notify")
void notify() { ... }
}
You can put another Dispatcher Servlet in
and configure it with the same XML file as your main dispatcher servlet.