tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: RequestDispatcher.forward() to doc located on HTTP Server
Date Mon, 11 Apr 2005 19:02:39 GMT
You might have better luck using a redirect. This should cause the 
client to request the alternate resource which Apache would then serve.

Mark

Ron Crayton wrote:
> Is it possible to use Request.forward() to forward a request to an html document located
on an HTTP Server?
>  
> I'm using Tomcat 5.5.7 and Apache 2.0.
>  
> I have a document setting in the htdocs folder of Apache 2.0 that I'm trying to forward
to from an application deployed in Tomcat 5.5.7.
>  
> I have this context in my server.xml file:
>  
> <Context path="/LoginApp" docBase="LoginApp" debug="0" reloadable="true" crossContext="true">
> <Logger className="org.apache.catalina.logger.FileLogger" prefix="LoginApp." suffix=".log"
timestamp="true"/>
> </Context>
>  
> I have this code in my app:
>  
> ServletContext context = getServletConfig().getServletContext();
> String uri = request.getQueryString();
>         
> ServletContext foreignContext = context.getContext("/");
> RequestDispatcher requestDispatcher = foreignContext.getRequestDispatcher(uri);
> requestDispatcher.forward(request, response);
>  
> The uri comes from the query string of the original request.
> When the code runs it says that the requested resource is not available - Error 404.
>  
> Am I trying to do something that's impossible?
>  
> Please help.
>  
>  
> 
> 		
> ---------------------------------
> Do you Yahoo!?
>  Yahoo! Small Business - Try our new resources site! 


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


Mime
View raw message