tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eryq <>
Subject Why does servlet.jar break servlets?
Date Wed, 29 Aug 2001 15:59:41 GMT
I've noticed something which seems quite odd.

It appears that I need the javax.servlet.* classes in
order to compile my servlet, to get classes such as
javax.servlet.http.HttpServletRequest, etc.

The classes can be found in a servlet.jar included
with TDK-2.1, in common/lib.

However, it appears that servlet.jar does not need
to be in the WEB-INF/lib directory of a servlet
in order for the servlet to run.

Furthermore. I have noticed that if I put servlet.jar 
in the WEB-INF/lib directory of a Tomcat4-b7 servlet
(including the "examples" servlets), it breaks them...
horribly.  I get ClassCastExceptions or worse.

I am guessing that javax.servlet is somehow
"special", and that it's the servlet container's
job to ensure that the servlet has access to it,
no matter what might be in the WEB-INF/lib directory.

I am also guessing that there might be a Servlet API 2.2
versus 2.3 issue going on.

Anyway, if anyone can shed more light on this,
I'd be very interested in understanding it a bit more.



View raw message