You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Paul Wallace <pw...@intelematics.com.au> on 2003/06/26 07:51:18 UTC

redirect from Servlet

Hello,
    I have a packaged servlet (com.mypackage.servlets;) in
WEB-INF\classes\com\mypackage\servlets, where it performs its logic
dutifully. From the servlet I wish to redirect back to the JSP that
called it. Currently the JSP origin cannot be found (404). I have tried
all manner of variations of path: 

res.sendRedirect("addAgent.jsp");

including a fully formed URL (local and HTTP). How do I redirect to the
desired file please?

Thanks

Paul.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: redirect from Servlet

Posted by Dayan Simon <da...@nikkelindia.com>.
Try this
getServletConfig().getServletContext().getRequestDispatcher("/xxx.jsp").
forward(request, response);

----- Original Message -----
From: "Paul Wallace" <pw...@intelematics.com.au>
To: "Tomcat Developers List" <to...@jakarta.apache.org>
Sent: Thursday, June 26, 2003 11:21 AM
Subject: redirect from Servlet


> Hello,
>     I have a packaged servlet (com.mypackage.servlets;) in
> WEB-INF\classes\com\mypackage\servlets, where it performs its logic
> dutifully. From the servlet I wish to redirect back to the JSP that
> called it. Currently the JSP origin cannot be found (404). I have tried
> all manner of variations of path:
>
> res.sendRedirect("addAgent.jsp");
>
> including a fully formed URL (local and HTTP). How do I redirect to the
> desired file please?
>
> Thanks
>
> Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org