You should use:
<jsp-file>/SomeServlet.jsp</jsp-file>
From the documentation:
Note: The
<jsp-file>
must start with a forward slash (/) if the JSP is in the application's root directory.
Pergunta
I am running into a problem with invoking JSP files inside a Google App Engine application. Here is an equivalent version of the relevant configuration in web.xml
:
<servlet>
<servlet-name>SomeServlet</servlet-name>
<jsp-file>SomeServlet.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>SomeServlet</servlet-name>
<url-pattern>/prefix</url-pattern>
</servlet-mapping>
When I try accessing SomeServlet
in the development environment at http://localhost:8888/prefix
this works fine, however if I try it in production at http://someapp.appspot.com/prefix
I get HTTP error 404 (Not Found). It's war/SomeServlet.jsp
in the file system. There is no further information in the server logs. I have also tried various access control configurations but to no avail.
What could be the reason for this failure?
Solução
You should use:
<jsp-file>/SomeServlet.jsp</jsp-file>
From the documentation:
Note: The
<jsp-file>
must start with a forward slash (/) if the JSP is in the application's root directory.