Search code examples
javagoogle-app-engineservletsweb.xmlurl-pattern

web.xml servlet mapping infinite loop


I am using appengine and seem to be having some problems with url routing

My web.xml

<servlet>
    <servlet-name>ViewServlet</servlet-name>
    <jsp-file>viewdata.jsp</jsp-file>
</servlet>

<servlet-mapping>       
    <servlet-name>ViewServlet</servlet-name>
    <url-pattern>/view/*</url-pattern>
</servlet-mapping>


<welcome-file-list>
    <welcome-file>default.html</welcome-file>
</welcome-file-list>

The redirection works just fine when I test in the local machine. On upload to appengine when I try to navigate to http://myurl/view/ it redirects infinitely to

http://myurl/view/default.html/default.html...

Is this the right way to redirect in web.xml. Am I missing something here. It work fine on the local machine. Just goes into an infinite loop when uploaded onto gae. Any help would be appreciated...


Solution

  • Note that the <jsp-file> must start with a forward slash (/) if the JSP is in the application's root directory.