tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: enabling/disabling a servlet filter conditionally
Date Mon, 04 Aug 2008 13:37:20 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

André,

André Warnier wrote:
| I have one more question, if you would be so kind and if it is not too
| heavy to handle here (and at the risk of sounding very "amateur") :

Hey, this list is what its members make of it. If [all of] you want to
discuss simple stuff, so be it. But it's much more interesting when
people ask interesting questions instead of things like "how do I
install Java?", so I welcome questions whose answers result in people
learning things they can't learn from copying an example from a tutorial.

| In the standard configuration, the JCIFS filter comes as a jar, which
| gets placed in the WEB-INF/lib sub-dir of the webapp.
| If I need to "build it into" my own filter, how do I do that?

You don't need to do anything special at all. The webapp's classloader
will fetch the appropriate class from wherever it is stored -- whether
it be in a JAR in your WEB-INF/lib directory or as a .class file in your
WEB-INF/classes hierarchy.

| Do I unpack the jar first when and where I compile my own filter, so
| that the classes are available then ?

Nope. You can just use the JAR file as a compile-time dependency for
your filter (or the entire webapp if you prefer).

| I compile my filter right now with a very basic method, using a
| command-file (under Windows) like :
|
| echo on
| set JAVA_HOME=c:\java1.5
| javac -classpath
|
%CLASSPATH%;C:\java1.5\lib\tools.jar;C:\java1.5\jre1.5\lib\jsse.jar;C:\Tomcat5\common\lib\servlet-api.jar;C:\Tomcat5\common\lib\commons-el.jar

| %1

Time to move to ant, baby. Once you get over the fact that it's just
/not/ 'make', you'll learn to love it.

| Do I just add the jar in question to the classpath above ?

Yup.

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

iEYEARECAAYFAkiXBhAACgkQ9CaO5/Lv0PASZgCeIpkOM7/ofi4WeCoPg8cPjjNH
ojEAoI7DRYj9++Ba+7CmVpaBUxQohZOc
=HIxo
-----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


Mime
View raw message