Re: putting custom code in front of Struts Main Servlet

2002-07-31 Thread Craig R. McClanahan



On Wed, 31 Jul 2002, Chris Ruegger wrote:

> Date: Wed, 31 Jul 2002 09:18:21 -0400
> From: Chris Ruegger <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> 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?
>

If you want to intercept each request before it gets to the Struts
controller servlet (or any other resource in your app), filters are
definitely the way to go.  There are some pointers to tutorial information
on the Servlet page at java.sun.com
.  There's also *lots* of good
tutorial information on web application development in the Web Services
Pack tutorial (start at ).

> Thanks
>
>

Craig



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: putting custom code in front of Struts Main Servlet

2002-07-31 Thread jeff . guttadauro


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"  
  
  
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
... 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]>




RE: putting custom code in front of Struts Main Servlet

2002-07-31 Thread Michael Remijan

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 
... 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:   
For additional commands, e-mail: