When trying to forward my .jsp to another <Context> in Tomcat 6.0.18 using
the following code, I get the following error:

      ServletContext appContext = ServletContext.getContext( "/dev" );

      if ( appContext != null )
      {
         RequestDispatcher rd = appContext.getRequestDispatcher(
contextPathFilter );
         rd.forward( request, response );
      }

Error ==> non-static method getContext(java.lang.String) cannot be
referenced from a static context


The following code compiles, but only forwards my new <Context> (/dev)
appended to the SAME CONTEXT (/filter) as /filter/dev.

      ServletContext appContext = getServletContext();

      if ( appContext != null )
      {
         RequestDispatcher rd = appContext.getRequestDispatcher(
contextPathFilter );
          rd.forward( request, response );
      }

As I said before, my goal is to forward my request/response from one
<Context> to another new <Context>.  Does someone have an example how to do
this?  I already added crossContext="true" to context.xml for both the
original and new <Context>.

Thanks,

Brandon


behofmann wrote:
> 
> In Tomcat 6.0.18, isn't it possible to forward a request/response from one
> <Context> to another?  Is there some special method/code to accomplish
> this?
> 
> Thanks,
> 
> Brandon
> 

-- 
View this message in context: 
http://www.nabble.com/Forwarding-from-one-Context-to-another-tp22767662p22774166.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to