I'm following this example to get Spring up & running: http://static.springsource.org/docs/Spring-MVC-step-by-step/part2.html
What they do is move all .jsp files inside the WEB-INF, to stop users accessing them directly... so far so good. However the servlet has a welcome page of index.jsp, and when this is moved inside the WEB-INF dir I get errors. I can't determine if Tomcat 6 should allow the welcome page to be inside WEB-INF or not?
The server looks for the welcome file in the following sequence by default: welcome-file-list in web. xml.
In a java-based web application, the HTML or JSP program can be configured as a welcome page.
The welcome files mechanism allows you to specify a list of files that the web container will use for appending to a request for a URL (called a valid partial request) that is not mapped to a web component.
Nothing inside WEB-INF can be directly accessed, but must first pass through something else (usually a servlet), which then forwards the request internally to the WEB-INF resource.
I am trying the same tutorial. The tutorial doesn't say this but I changed the value in my web.xml from "index.jsp" to "/WEB-INF/jsp/index.jsp".
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