This also depends on when you want the code executed.  I believe overriding
init will only make that code execute when the servlet is first created.  If
you want code executed on every call to the process method, someone here did
it by overriding the processPreprocess (method name? - have to check
ActionServlet source) method and do the rest of the stuff Mike has suggested.
HTH



                                                                                       
                                  
                    "Michael Remijan"                                                  
                                  
                    <Michael.Remijan@so        To:     "Tomcat Users List" 
<[EMAIL PROTECTED]>              
                    locup.com>                 cc:                                     
                                  
                                               Subject:     RE: putting custom code in 
front of Struts Main Servlet      
                    07/31/02 08:16 AM                                                  
                                  
                    Please respond to                                                  
                                  
                    "Tomcat Users List"                                                
                                  
                                                                                       
                                  
                                                                                       
                                  




What I did is extend the org.apache.struts.action.ActionServlet override the
init() method and then in WEB-INF/web.xml use the name of your class for the
<servlet-class>...</servlet-class> entry.


Mike


-----Original Message-----
From: Chris Ruegger [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:18 AM
To: Tomcat Users List
Subject: putting custom code in front of Struts Main Servlet


This is a bit off topic but we are using Tomcat with Struts.
We want to be able to always execute some code before
the Struts servlet is invoked, to check for things like lost
session, permission, etc.  What is the best way to do this?
I'm thinking either have a servlet that we send everything to,
then have it call the Struts servlet, or use servlet filters
somehow (have not used them yet but vaguely familiar with them)
What approaches have others used for this?

Thanks



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>






--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to