I have a Spring application, which is running on Tomcat say at: http://example.com/foo/
DisplatcherServlet is mapped to app/*, for example, index page is:
http://example.com/foo/app/index.html
This is so because I have other servlets (for HttpRequestHandlers), e.g. mapped to service/*. This scheme is convenient to use because this way app/ and service/ can have different security settings.
What I want is http://example.com/foo to redirect to http://example.com/foo/app/index.html.
How do I achieve this?
In your web.xml, you can define a welcome file, seen when navigating to the root of the app:
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
You can then make a tiny index.jsp that redirects to where you want:
<% response.sendRedirect("app/index.html"); %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With