RE: problems with sendRedirect() on relative path
try using getContext() and getRequestDispatcher() and then include(req, res) you can set a context in the server.xml to point to a directory where you keep these static pages eg staticPages with the path set to c:\staticPages then using the config.getContext(/staticPages).getRequestDispatcher().include 'or forward' (request, response) will forward to the or include the static page this is not the same as redirect but it's just another suggestion that might help Phill -Original Message- From: Ofer Baranes [mailto:[EMAIL PROTECTED]] Sent: 06 June 2001 12:45 To: '[EMAIL PROTECTED]' Subject: problems with sendRedirect() on relative path Hi I am tring to use the HttpServletResponse sendRedirect() method to show a static page but i can't use relative path only static path (which include the context).The problem occure because of the default '/servlet' prefix which is used on tomcat conf\servel.xml.This default prefix force that each accses to servlet will contain the /servlet on the URI. Does anyone know how to solve that ?
Re: problems with sendRedirect() on relative path
Hi Ofer! You can specify a different context, that will not contain the /servlet prefix. The prefix is set by context. I don't think the suggestion that was sent before (RequestDispatcher) will work, since it's a static page. Un saludo, Alex. Ofer Baranes wrote: Hi I am tring to use the HttpServletResponse sendRedirect() method to show a static page but i can't use relative path only static path (which include the context).The problem occure because of the default '/servlet' prefix which is used on tomcat conf\servel.xml.This default prefix force that each accses to servlet will contain the /servlet on the URI. Does anyone know how to solve that ?
RE: problems with sendRedirect() on relative path
Alex , actually i just learnd that using the RequestDispatcher is a better solution since the response is for this request while redirct is creating new requestresponse. By the way the RequestDispatch is showing static pages. Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 06, 2001 12:43 PM To: [EMAIL PROTECTED] Subject: Re: problems with sendRedirect() on relative path Hi Ofer! You can specify a different context, that will not contain the /servlet prefix. The prefix is set by context. I don't think the suggestion that was sent before (RequestDispatcher) will work, since it's a static page. Un saludo, Alex. Ofer Baranes wrote: Hi I am tring to use the HttpServletResponse sendRedirect() method to show a static page but i can't use relative path only static path (which include the context).The problem occure because of the default '/servlet' prefix which is used on tomcat conf\servel.xml.This default prefix force that each accses to servlet will contain the /servlet on the URI. Does anyone know how to solve that ?
Re: problems with sendRedirect() on relative path
Interesting, didn't know that. Thanks, Alex. Ofer Baranes wrote: Alex , actually i just learnd that using the RequestDispatcher is a better solution since the response is for this request while redirct is creating new requestresponse. By the way the RequestDispatch is showing static pages. Thanks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 06, 2001 12:43 PM To: [EMAIL PROTECTED] Subject: Re: problems with sendRedirect() on relative path Hi Ofer! You can specify a different context, that will not contain the /servlet prefix. The prefix is set by context. I don't think the suggestion that was sent before (RequestDispatcher) will work, since it's a static page. Un saludo, Alex. Ofer Baranes wrote: Hi I am tring to use the HttpServletResponse sendRedirect() method to show a static page but i can't use relative path only static path (which include the context).The problem occure because of the default '/servlet' prefix which is used on tomcat conf\servel.xml.This default prefix force that each accses to servlet will contain the /servlet on the URI. Does anyone know how to solve that ?