tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergio <ser...@strategos.com.br>
Subject Valve to intercept outgoing requests
Date Wed, 06 Apr 2011 12:19:44 GMT
I made this Valve, trying to intercept requests going out of my 
"WebPages" context to the "Webservices" context. Right now they are both 
running in the same Tomcat (5.5.33), but that may not be true in the future.

public class TestValve extends org.apache.catalina.valves.ValveBase {
     @Override
     public void invoke(Request request, Response response) throws 
IOException, ServletException {
         System.out.println("TestValve");

         if (request.getRequestURI().contains("/WebPages")) {
             System.out.println("TestValve: context /WebPages");
             String teste = (String) 
request.getSession().getAttribute("test");
             request.setAttribute("test", teste);
         }

         getNext().invoke(request, response);
     }
}

The idea is to intercept the request to implicitly set attributes to be 
recovered at the "Webservices" context. This is not working. Any ideas why?

Sergio

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


Mime
View raw message