You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Peter Kriens <Pe...@aQute.se> on 2005/11/21 18:07:50 UTC

Re[2]: servlet.jar

Actually, to my great surprise, you are compatible when you take a
greater version than 2.1. The spec says:

        "Http Service implementations must support at least
        version 2.1 of the Java Servlet API."

Not much room left for interpretation. So implementing a later version is
ok. Kind regards,

   Peter Kriens

KS> Hmm...
KS> That's not quite the question I wanted answered.
KS> I realize that an implementation of the Http service built on the 2.1
KS> servlet API will only work with a 2.1 servlet.jar.
KS> What I'm wondering is if it's compliant to build an Http Service
KS> implementation based on the 2.4 API (with the subsequent requirement of
KS> having a 2.4 servlet.jar available at runtime).

KS> The Http Service spec says that you must support at least the Servlet
KS> 2.1 API.
KS> I'm interpreting this to mean 2.1 or higher as the APIs are backwards
KS> compatable for the Servlet (but obviously not the Servlet Container
KS> implentation). By this I mean a Servlet written for 2.1 will also work
KS> in a 2.4 Servlet Container.

KS> Many Servlets are written with dependencies on a version of the Servlet
KS> API higher than 2.1 and it would be a shame not to support them. I don't
KS> see any technical problems with using a later version of the Servlet API
KS> for the Servlets themselves. What's more, an Http Service implentation
KS> based on the 2.4 Servlet API should be able to support service clients
KS> trying to register Servlets written for 2.1, 2.2, 2.3, or 2.4.

KS> I don't see anything in the specification saying that it is mandatory to
KS> build an HttpService with exactly and only a Servlet 2.1 implementation
KS> and as I see it the only reason you would want a 2.1 servlet.jar is if
KS> you were supporting an existing implementation built on the 2.1 API.

KS> I've done a fair bit of integration work assuming that with an
KS> HttpService implementation based on Servlet 2.4 I'll be able to use my
KS> existing Servlets that require Servlet API 2.4.
KS> Looking for some clarification.

KS> -Simon

>> -----Original Message-----
>> From: Marcel Offermans [mailto:marcel.offermans@luminis.nl] 
>> Sent: Sunday, November 20, 2005 6:57 PM
>> To: felix-dev@incubator.apache.org
>> Subject: Re: servlet.jar
>> 
>> Kaegi, Simon wrote:
>> 
>> >Trying to understand...
>> >Is the spec saying that you cannot build a servlet 2.3 compliant 
>> >version.
>> >  
>> >
>> The spec itself does not prohibit you from building anything. 
>> Basically the spec describes a framework and a collection of 
>> services. Some of these services are "mandatory", others are 
>> optional. But as a user of the OSGi framework, you decide 
>> which of these services you actually want to use. It's 
>> perfectly fine to just use the framework and only use 
>> services you've defined yourself.
>> 
>> >e.g. Would an Http Service Impl with the following declaration be 
>> >non-compliant?
>> >
>> >Export-Package: org.osgi.service.http; version=1.2; 
>> >uses:="javax.servlet, javax.servlet.http",
>> >     javax.servlet; version=2.3,
>> >     javax.servlet.http; version=2.3
>> >
>> >
>> >It seems to me that this would work with a bundle holding a Servlet
>> >with
>> >
>> >Import-Package: org.osgi.service.http; version=1.2,
>> >     javax.servlet; version=2.1,
>> >     javax.servlet.http; version=2.1 
>> > 
>> >as well as a version=2.3 Servlet bundle since Servlet 
>> doesn't require 
>> >any new methods.
>> >
>> >As was pointed out a 2.1 implementation won't work with 2.3 servlets.
>> >So my question is (and I've probably misunderstood 
>> something) why would 
>> >you want to implement a 2.1 version when a 2.3 or 2.4 version is 
>> >backwards compatable?
>> >  
>> >
>> Because, according to BJ, it is not: "If you try and run an 
>> HttpService impl  built to servlet 2.1 with a servlet 2.2 or 
>> 2.3 jar file, you will get verifier errors since the 
>> implementation of the ServletRequest and ServletResponse 
>> interfaces do not implement all of the declared methods."
>> 
>> Greetings, Marcel
>> 
>> 
>> 
  
KS>        This message may contain privileged and/or
KS> confidential information.  If you have received this e-mail in
KS> error or are not the intended recipient, you may not use, copy,
KS> disseminate or distribute it; do not open any attachments, delete
KS> it immediately from your system and notify the sender promptly by
KS> e-mail that you have done so.  Thank you. 
        
 


-- 
Peter Kriens                              Tel +33870447986
9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
34160 Beaulieu, France                    ICQ 255570717
Skype pkriens                             Fax +1 8153772599