0
votes

When using the dev server this url [localhost:8888/drive] gets automaticaly redirected to [localhost:8888/drive/]. The trailing slash is added so that the default index.html will be served.

But once I uploaded to App Engine it no longer works. The automatic redirection is not happening. artcowles.appspot.com/drive is not automatically being redirected to artcowles.appspot.com/drive/

One last bit of info: "drive" is a static folder in the WAR directory.

Why is the dev server performing different than production?

Is there some configuration I can set in my web.xml or appengine-web.xml that will mimic the dev server behaviour?

Or do I just need to add my own redirect?

Thanx

1

1 Answers

0
votes

Did you set welcome file in your web.xml?

<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.html</welcome-file>
</welcome-file-list>

check this out.

UPDATE : If you use Servlet you can try this for redirection :

in web xml add this set :

<servlet>
    <servlet-name>RedirectionServlet</servlet-name>
    <servlet-class>com.Servlet.RedirectionServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>RedirectionServlet</servlet-name>
    <url-pattern>/</url-pattern>
</servlet-mapping>

RedirectionServlet.java

public class RedirectionServlet extends HttpServlet {

protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
    response.sendRedirect("index.jsp");
} 

let me know if its working or not..