Tim's solution is the easiest, but allow me to explain why your application
is behaving that way.

By specifying the following

      <url-pattern>/</url-pattern>


You are saying that all requests that come into your application are to be
forwarded to the servlet.  Thus when you redirect to "/jsp/index.jsp" it is
taking back into the servlet.  My guess is that you are trying to force
everyone to the /jsp/index.jsp" page no matter which "url" they use to get
to your application.  I do not know of an easy way to do this.  I like Tim's
solution and hopefully that will fulfill your needs.

HTH


On 9/12/06, Tim Funk <[EMAIL PROTECTED]> wrote:

If I am reading this correctly, an "easier" solution would be to create
an index.jsp at the root level that forwards to "/jsp/index.jsp"

-Tim

Romain Quilici wrote:
> Hi all,
> this question seems simple, but I did not figure out how to answer it.
>
> In my web.xml I have defined a default servlet. So it can handle
> requests that does not match other servlets pattern.
> <servlet-mapping>
>       <servlet-name>DefaultServlet</servlet-name>
>       <url-pattern>/</url-pattern>
>    </servlet-mapping>
>
> Then in my DefaultServlet, I want to redirect to a jsp page, so I use
> RequestDispatcher dispatcher =
> getServletContext().getRequestDispatcher("/jsp/index.jsp");
>        if(dispatcher != null){
>            dispatcher.forward(request,response);
>        }
>
> But doing that, I reenter in my default servlet's doGet method.
>
> What I want is rather simple, when a user connect to the site
> http://server/myapp/, then the request is handled by the default
> servlet and the jsp page is displayed


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Marc Farrow

Reply via email to