问题
I'm trying to build a JAX-RS based web service using IBM RAD 7.5.5 (which is basically Eclipse + plugins) and WebSphere 6.1.
When I create a new Dynamic Web Project, I get the "New Dynamic Web Project" dialog box.
For "Target Runtime", when I pick "WebSphere 6.1", the "Dynamic Web Module" is 2.4 and when I modify the Configuration there is no "JAX-RS (REST web services)" to select in the list.
However, for "Target Runtime", when I pick "WebSphere 7.0", the "Dynamic Web Module" is 2.5 and modify the Configuration there IS a "JAX-RS (REST web services)" to selected in the list.
So my question is, why isn't "JAX-RS" in the list for WebSphere 6.1 / Dynamic Web Module 2.4? Is it simply not supported? If someone could explain why and what the number "2.4" means, it would be greatly appreciated!
Thanks, Rob
回答1:
After some digging I can answer my own question ...
The "Dynamic Web Project" number (2.2, 2.3, 2.4, 2.5) corresponds to the version of the Servlet spec (example. Servlet 2.4, Servlet 2.5, Servlet 3.0).
Servlet 2.4 (supported by WebSphere 6.1) uses J2EE 1.4 and J2SE 1.3.
Servlet 2.5 (supported by WebSphere 7.0) uses Java EE 5 and Java SE 5.
Servlet 3.0 (possibly supported by WebSphere 8.0?) uses Java EE 6 and Java SE 6.
So, JAX-RS requires annotations which means it needs Java SE 5, and therefore Servlet 2.5.
来源:https://stackoverflow.com/questions/9279296/what-is-eclipse-dynamic-web-module-number-why-isnt-jax-rs-in-the-project-fac