Eclipse中的动态Web模块选项 [英] Dynamic Web Module option in Eclipse

查看:313
本文介绍了Eclipse中的动态Web模块选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释这个选项的目的,究竟是什么。



看起来我的eclipse安装是默认的是3.0,但它不会在Tomcat 5.5服务器上运行,可能不是Tomcat 6.0
是否与servlet规定Tomcat服务器支持?如果是这样,我需要使用哪个版本的Tomcat 5.5和Tomcat 6.0?



而且,我认为我使用的编译器版本和选择的Web模块版本之间有一个链接。有没有一些说明这种关系的文件?



编辑



而且,为什么如果我选择v2.4 web模块,它默认为JDK 1.4?



谢谢

解决方案

该版本与Servlet API相关版。 Servlet 3.0 (作为Java EE 6的一部分在2009年12月发布)仅运行在Servlet 3.0容器上(Tomcat 7,Glassfish 3,JBoss AS 6等)。 Servlet 2.5 (2006年11月发布,作为Java EE 5的一部分) )仅在Servlet 2.5容器或更新版本(Tomcat 6,Glassfish 2,JBoss AS 5等)上运行。运行 Servlet 2.4 (作为J2EE 1.4的一部分在2003年11月发布)在Servlet 2.4容器或更新的等等。



您只需要选择正确的API版本,无论您想要实现您的webapp,或者如果您没有选择servlet容器的自由,然后选择适合servlet容器版本的API最好。



至于为什么JDK默认为一个或其他,它只是有关Servlet API版本的最低JDK要求。通常,当您选择较旧的Servlet API时,实际上所使用的JRE / JDK也是旧的。


Could someone please 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.

这篇关于Eclipse中的动态Web模块选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆