HI All,

Thanks scott, i used a filter to do this but i am not sure how to do it with a tomcat 
valve any way the filter looks like this 

  |     public void doFilter(ServletRequest request, ServletResponse response, 
FilterChain chain)
  |                     throws IOException, ServletException
  |             try
  |             {
  |                     WorkServerWebEJBServiceLocator.getInstance().performLogin();
  |                     chain.doFilter(request, response);
  |             }
  |       catch (ServiceLocatorException aException)
  |       {
  |         cCat.error("WorkServerWebEJBServiceLocator Login error.");
  |         cCat.debug("WorkServerWebEJBServiceLocator Login error.", aException);
  |       }
  |             finally
  |             {
  |         try
  |         {
  |             WorkServerWebEJBServiceLocator.getInstance().performLogout();
  |         }
  |         catch (ServiceLocatorException aException)
  |         {
  |           cCat.error("WorkServerWebEJBServiceLocator Logout error.");
  |           cCat.debug("WorkServerWebEJBServiceLocator Logout error.", aException);
  |         }
  |             }
  | 
  | 
  | 
I configured this filter for all URLs like using /* mapping . the performlogin and 
logout methods does the following

  |       try
  |       {
  |         UsernamePasswordHandler tHandler = new UsernamePasswordHandler(iUserName, 
  |             iPassword.toCharArray());
  |         iLoginContext = new LoginContext("client-login", tHandler);
  |         iLoginContext.login();
  |         cCat.info("Login With :" + iUserName + ":" + iPassword);
  |       }
  |       catch (LoginException aException)
  |       {
  |         cCat.error("Could not login for the LoginContext.");
  |       }
  | 
  | 

i hope this will help 

regards
jani

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3834020#3834020

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3834020


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to 
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to