Hi John,

I did consider implementing a filter, even started writing the code, but then 
decided against it, although I can't remember why right now. I'm sure I'll 
remember in the morning :)
Maybe it's something that can be solved, though. You do make a case for 
writing a filter instead of trying to do this with a servlet.

Thanks,
Frans

On Wednesday 18 August 2004 15:51, John Villar wrote:
> 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

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

Reply via email to