What Yoav (Cicer0 on irc as a guess ;-) ) says is true.... if you need special processing based on the url, implementing a filter is the most straightforward, simple and elegant way. By no means you should need to modify the tomcat codebase for a special app, because that way you're ensuring non-portability, and that totally breaks the spirit of Servlets.

Shapira, Yoav escribi�:

Hi,
Can you just use a Filter and save yourself a ton of trouble?

Yoav Shapira
Millennium Research Informatics




-----Original Message-----
From: Frans Flippo [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 18, 2004 8:42 AM
To: Tomcat Users List
Subject: Subclassing DefaultServlet

Hi,

I've added some functionality to DefaultServlet by subclassing it (i.e.
we need to do some special processing to certain URLs, for others I


will


just call super.doGet(...)). I compiled the DefaultServlet subclass
against Tomcat's servlets-default.jar in server/lib and deployed it in
my web application (adding a relevant servlet mapping to my web.xml).

When I first tried it I got a ClassNotFoundException for


DefaultServlet,


probably due to the fact that the Tomcat server and the web


applications


use seperate class loaders, so our web application's class loader does
not have a copy of DefaultServlet loaded. I had to copy several JARs


from server/lib to my web application's WEB-INF/lib directory,
including


servlets-default.jar, which contains DefaultServlet. I'd rather just
refer to the JARs in server/lib, though. That way I know that when the
web application is deployed to a newer version of Tomcat, the
DefaultServlet I'm subclassing from and the one Tomcat uses will be the
same.

Besides symlinking, is there any way achieve this? Can I tell tomcat to
also include server/lib in the classpath for my webapp?

Thanks in advance,
Frans

--
Quinity : Your Partner In eBusiness Solution Delivery

Biltstraat 449
3572 AW Utrecht
P.O. Box 13097
3507 LB Utrecht
The Netherlands

Telephone: (+31) (0)30 2335999
Fax : (+31) (0)30 2335998
WWW : http://www.quinity.com
================================================================
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential
and/or privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in
reliance upon, this information by persons or entities other
than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material


from any computer. Quinity is neither liable for the proper and


complete  transmission of the information contained in this
communication nor for any delay in its receipt.
================================================================



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






This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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







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



Reply via email to