Invoking JSP inside Google App Engine application results in 404 error on production server, works on development server

StackOverflow https://stackoverflow.com/questions/22715159

Pregunta

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 SomeServletin the development environment at http://localhost:8888/prefixthis 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?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top