You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Trumml <Ma...@systema.info> on 2007/07/26 14:25:31 UTC

Execute method each request

I want to execute a method each time a request is performed to my jsf site.
The implementation for this request should remain in a jar file which is
packed into the WAR file under WEB-INF/lib directory.
I guess there is no solution to do this with a valve, because the class
(jar) for the valve must remain inside tomcat classpath I guess.
Is there any other solution to invoke a method of a class inside the
WEB-INF/lib directory each request... Additionally the method must be
executed in the thread of the request.

I deploy the WAR into JBoss 4.0.5 with tomcat 5.5
-- 
View this message in context: http://www.nabble.com/Execute-method-each-request-tf4151311.html#a11809468
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Execute method each request

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Trumml,

Trumml wrote:
> I want to execute a method each time a request is performed to my jsf site.
> The implementation for this request should remain in a jar file which is
> packed into the WAR file under WEB-INF/lib directory.
> I guess there is no solution to do this with a valve, because the class
> (jar) for the valve must remain inside tomcat classpath I guess.

Don't use a valve. Use a Filter. These were designed to be deployed as
part of your application, instead of being provided by Tomcat.

Look at the servlet API for javax.servlet.Filter (it's an interface).
Implementing it is easy: just read the javadoc before you begin and
you'll be good to go.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGqPAH9CaO5/Lv0PARAheAAJ0dRPWqCirlFGuQP2dLgla0PCwYXwCgnMLb
7tDsS/ldmm4hSeB1G9bY3N4=
=xhw5
-----END PGP SIGNATURE-----

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


Re: Execute method each request

Posted by David Smith <dn...@cornell.edu>.
What you describe is exactly what filters were created for.  It's even 
in the servlet spec, making it a requirement of all java servlet containers.

--David

Trumml wrote:

>I want to execute a method each time a request is performed to my jsf site.
>The implementation for this request should remain in a jar file which is
>packed into the WAR file under WEB-INF/lib directory.
>I guess there is no solution to do this with a valve, because the class
>(jar) for the valve must remain inside tomcat classpath I guess.
>Is there any other solution to invoke a method of a class inside the
>WEB-INF/lib directory each request... Additionally the method must be
>executed in the thread of the request.
>
>I deploy the WAR into JBoss 4.0.5 with tomcat 5.5
>  
>


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