tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Re: Detect servlet API? (was Bug Tracking -- note)
Date Fri, 28 Jul 2000 16:47:32 GMT
Nick Bauman wrote:

> Is there a clean way to detect the servlet API and use
> the appropriate call? Or should the older APIs go
> unsupported?
>

ServletContext.getMajorVersion() and ServletContext.getMinorVersion()
will tell you what the servlet container supports.  However, if a
particular application is using a compatible subset of the method calls,
there is pretty much no way to tell what version it relies on unless
there is docco saying so that comes with the app.

In the case at hand, servlet 2.0 didn't have a concept of web
applications (or even formally specify the mapping rules for what parts
of the request URI go to what request getters).  Any app that relies on
the semantics of 2.0 (as opposed to the syntax) is going to have problems
in a 2.2 environment unless you run it in the root webapp.  Even then,
there are lots of other issues that can bite you (like the fact that
ServletContext.getServlet() now returns null unconditionally).

Craig



Mime
View raw message