Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » Annotation in Dynamic Web Project (cannot change version of project facet dynamic web module 2.5)
Annotation in Dynamic Web Project (cannot change version of project facet dynamic web module 2.5) [message #852147] Sat, 21 April 2012 14:27 Go to next message
Eclipse UserFriend
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 00:14] by Moderator

Re: Annotation in Dynamic Web Project [message #852479 is a reply to message #852147] Sat, 21 April 2012 23:13 Go to previous messageGo to next message
Eclipse UserFriend
This can be fixed during project creation by checking [Generate web.xml deployment descriptor] checkbox in the [Web Module] pane. Then each initialized parameter added during new servlet creation will be available in web.xml.
Re: Annotation in Dynamic Web Project [message #852492 is a reply to message #852479] Sat, 21 April 2012 23:30 Go to previous messageGo to next message
Eclipse UserFriend
No, checking that checkbox will not resolve the issue.
Re: Annotation in Dynamic Web Project (cannot change version of project facet dynamic web module 2.5 [message #1173226 is a reply to message #852147] Wed, 06 November 2013 06:25 Go to previous messageGo to next message
Eclipse UserFriend
Sorry, I really need "wake up" this topic...

I have the same problem, I'm using maven-war-plugin, I need tomcat6, javaee5, e dynamic web 2.5

BUT I can't... Anybody found a solution?
Re: Annotation in Dynamic Web Project (cannot change version of project facet dynamic web module 2.5 [message #1174055 is a reply to message #1173226] Wed, 06 November 2013 18:05 Go to previous message
Eclipse UserFriend
What I did is removed Dynamic Web Facet 3.0 by deselecting it in Projects Facets preferences for the project. Hit Apply and then enabled it again with required version. Worked for me. Don't forget to back up your project before trying this workaroung.
Previous Topic:Trouble with preferences when using XMLMultiPageEditorPart
Next Topic:Webservice client project option missing
Goto Forum:
  


Current Time: Wed Jul 23 17:11:17 EDT 2025

Powered by FUDForum. Page generated in 0.28789 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top