开发者

Dynamic Web Module option in Eclipse

开发者 https://www.devze.com 2023-01-21 20:25 出处:网络
Could someone pl开发者_如何学JAVAease explain the purpose of this option and what exactly it is for.

Could someone pl开发者_如何学JAVAease explain the purpose of this option and what exactly it is for.

It looks like the default is on my eclipse installation is 3.0 but it wont run on a Tomcat 5.5 server and probably not Tomcat 6.0 Is it related to the servlet spec that the Tomcat server supports? If so which version do i need to use for Tomcat 5.5 and Tomcat 6.0?

And also, i think there is a link between the compiler version that i use and the web module version selected. Is there some kind of documentation that explains what this relationship is?

Edit

And also, why is it that if i select v2.4 web module, it defaults to JDK 1.4?

Thanks


That version correlates with Servlet API version. Servlet 3.0 (released at december 2009 as part of Java EE 6) runs on Servlet 3.0 containers only (Tomcat 7, Glassfish 3, JBoss AS 6, etc). Servlet 2.5 (released at 11 may 2006 as part of Java EE 5) runs on Servlet 2.5 containers only or newer (Tomcat 6, Glassfish 2, JBoss AS 5, etc). Servlet 2.4 (released at november 2003 as part of J2EE 1.4) runs on Servlet 2.4 containers only or newer, etcetera.

You just need to pick the right API version whatever you want to implement your webapp in. Or if you don't have the freedom in picking the servlet container used, then pick the API which suits the servlet container version the best.

As to why the JDK defaults to one or other, it's just the minimum JDK requirement of the Servlet API version in question. Often, when you're picking an older Servlet API, in reality the JRE/JDK used is also that old.


The below are the jdk requirement for servlet API.

Please find the compatibilty.

Servlet 4.0     Java EE 8   
        
Servlet 3.1     Java EE 7   
        
Servlet 3.0     Java EE 6, Java SE 6

Servlet 2.5     Java EE 5, Java SE 5

Servlet 2.4     J2EE 1.4, J2SE 1.3  

Servlet 2.3     J2EE 1.3, J2SE 1.2  

Servlet 2.2     J2EE 1.2, J2SE 1.2  

I think this is helpful for you :)

Thanks

0

精彩评论

暂无评论...
验证码 换一张
取 消