I used to use Eclipse Galileo, but now I have Helios. Galileo used to automatically add my servlets to web.xml
, but in Helios I have to do this myself.
Is there something I can configure to make this automatic again?
I used to use Eclipse Galileo, but now I have Helios. Galileo used to automatically add my servlets to web.xml
, but in Helios I have to do this myself.
Is there something I can configure to make this automatic again?
This hasn't been changed. Most likely you have used New > Class instead of New > Servlet to create the servlet.
this post will help you ..
https://stackoverflow.com/a/14854907/1847899
"Tomcat 7 is a Servlet 3.0 compatible container. Since Servlet 3.0, the servlets can be configured by @WebServlet annotation on the class without the need for a web.xml configuration entry."
You need to change some settings on the project:
Next
(not `Finish)
Add
and give it the name you used in web.xml (like /mohan)
Now it should work.
you dont need to worry about that Tomcat 7 is a Servlet 3.0 compatible container. Since Servlet 3.0, the servlets can be configured by @WebServlet annotation on the class there is no need for a web.xml configuration entry.If you are still confused just change the "dynamic web module version" to 2.5 instead of 3.0 at this point... new-> dynamic web project. then you can see that your servlets will be configured in web.xml automatically