Using
Tomcat 5.5.9
I have a client requirement to redirect all requests to '/index.jsp' to '/'
In index.jsp, I added: response.sendRedirect("http://www.sitename.com/");
Since the welcome-file points to index.jsp, this becomes impossible because of an infinite loop.
So, I changed the welcome-file entry to 'main.jsp' and copied all of the 'content' from index.jsp into main.jsp. In index.jsp, I put the redirect to "http://www.sitename.com/".
Theoretically, all requests coming for /index.jsp should redirect to / and the default Tomcat
servlet should include the contents of 'main.jsp'. There are no redirects in main.jsp, just content.
This should work, however it isn't. I have an infinite loop of redirects occuring. I changed the welcome-file in /conf/web.xml and the apps WEB-INF/web.xml. I also didn't forget to restart tomcat.
PS, I also tried using .htaccess, that doesn't work because Tomcat is serving the page and not Apache.
Any thoughts on this ridiculous (but very important to me) matter?
Why is Tomcat not using the welcome-file that points to main.jsp?