I am trying to have a servlet (non-jsp) as my welcome file in tomcat 7 and the only way to do this is
by matching the "/" url pattern, otherwise it returns 404 not found if I try to access the url, i.e. http: // url / webapp /
Reading the servlet 2.4 specifications, it allows the servlet in the list of welcome files, why do I need to map it to the "/" url sample to make it work?
<servlet> <servlet-name>credentialServlet</servlet-name> <servlet-class>com.servlet.CredentialServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>credentialServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>credentialServlet</welcome-file> </welcome-file-list>
portoalet
source share