Konstantin,

Thanks for the info.  I think I'm getting close.  As a test, I have created
a valve that just forces a redirect.  It compiled fine.  I registered it
under the 'host' tag next to the other valves in server.xml.  When I send a
request in, my print statements write to System.out just as expected.

The only problem is, the request forward goes nowhere.  Just white screen
on the browser.  The requestDispatcher returns without any exceptions.  But
I can't find anything in the logs saying anything was wrong.  The code is
simple:

 public void invoke(Request request, Response response) throws IOException,
ServletException  {
    System.out.println( "in Valve" );
    try    {
       RequestDispatcher requestDispatcher = request.getRequestDispatcher(
"/cismanager/jsp/user/home.jsp" );
       System.out.println( "should get here" );
       requestDispatcher.forward( request, response );
       System.out.println( "return from forward");
    }
    catch( Throwable e)    {
       e.printStackTrace( System.out );
    }
//    getNext().invoke(request, response);
 }

I figure it's something to do with the URL.  I have never used a
RequestDispatcher obtained from the Request object outside of a webapp
context.  From what you said, the valve is 'above' the contexts at the
'host' level.  So I assume the parsing of the context out of the URL has
yet to occur and therefore should happen in my 'forward'.  Hence, I used
the entire URL (after the domain name) in the forward.  In the example
above, I have the webapp mapped to "/cismanager".

Am I close?  Or is this totally wrong?  Should I not use the
RequestDispatcher?  Should I somehow wrapper the request object and set the
new URL in that?

Thanks again for all the help.

Jerry

Reply via email to