org.openi.security.tomcat
Class LoginValve

java.lang.Object
  extended byValveBase
      extended byorg.openi.security.tomcat.LoginValve

public class LoginValve
extends ValveBase

Version:
$Revision: 1.1.1.2 $ $Date: 2005/07/11 18:00:34 $ A Valve that hooks up j_security_check request and sets j_password in session. Reasons: So with above constraints, the possible way is to use container to solve the above problem. With sacrifing portabily to deploy on different servlet container, we came up with the valve based solution supported by tomcat. The valve is similar as RequestFilter used in application. The container always called invoke method of each valve available in valve chain. Our valve just check the request for "j_security_check". If so, it retrieves j_password and sets in session. To use this valve :
Author:
dpokhrel
See Also:
Serialized Form

Constructor Summary
LoginValve()
           
 
Method Summary
 java.lang.String getInfo()
          Return descriptive information about this Valve implementation.
 void invoke(Request request, Response response, ValveContext context)
          process the request and test whether it is j_security_check or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginValve

public LoginValve()
Method Detail

getInfo

public java.lang.String getInfo()
Return descriptive information about this Valve implementation.


invoke

public void invoke(Request request,
                   Response response,
                   ValveContext context)
            throws java.io.IOException,
                   javax.servlet.ServletException
process the request and test whether it is j_security_check or not. If so, it stores j_password request parameter to a session variable "user.credentials". Which is later used by application to connect with XMLA web service.

Parameters:
request - Request
response - Response
context - ValveContext
Throws:
java.io.IOException
javax.servlet.ServletException