Annotation in Dynamic Web Project (cannot change version of project facet dynamic web module 2.5) [message #852147] |
Sat, 21 April 2012 18:27 |
roy lou Messages: 10 Registered: April 2012 |
Junior Member |
|
|
Environment:
Eclipse SR2 + Tomcat 7.0.26 + SE JDK 1.7
Description:
I created a servlet under a Dynamic Web Project in Eclipse and specified initialized parameter(s) in [Create Servlet] pane. After the new servlet is created, I couldn't locate <init-param> section in web.xml. Instead, the initialized parameters were found to be declared in the code as the form of annotation: @WebServlet(initParams = { @WebInitParam(name = "USD_CAD", value = "1.06")}) above servlet class definition.
Question:
1. Is there a way to create servlets within Dynamic Web Project without Eclipse using annotation approach? So that they will be showing in web.xml's <init-parm> sections? Thanks!
2. Does it take to configure somewhere in the Eclipse? Thanks!
From google result, i found out that i need to change my project facet from currently 3.0 to 2.5 to fix this issue. Howebver "cannot change version of project facet dynamic web module 2.5" is what i got whey i tried. Need someone to shed the light on this. Thanks!
[Updated on: Sun, 22 April 2012 04:14] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03363 seconds