0

I want to create a simple web application that runs on tomcat with pure java configuration. I know how to do it with Spring frameworks WebApplicationInitializer. But i don't know without Spring. I have heard about @WebServlet Please guide me.

Kazi
  • 113
  • 2
  • 13
  • Why without web.xml? It isn't Spring stuff, web.xml is JavaEE stuff. – BackSlash Jan 26 '17 at 10:38
  • This is true that from Java EE 6, web.xml is no longer required for a web app to deploy. Instead of using xml, you can use annotations to replace the xml file. Take a look at this : http://stackoverflow.com/questions/17236743/how-to-use-annotations-instead-of-web-xml-in-the-servlet-to-specify-url – Rouliboy Jan 26 '17 at 10:45
  • @Rouliboy : I was exactly looking for this reply. You can make it the answer if you want. BackSlash : I dont understand the point of downvoting this question when Java EE allows to create web apps without web.xml file. – Kazi Jan 26 '17 at 11:12
  • @Kazi : I updated the answer. Glad if this helped you :-) – Rouliboy Jan 26 '17 at 11:50

1 Answers1

1

This is true that from Java EE 6, web.xml is no longer required for a Webapp to deploy. Instead of using web.xml, you can use annotations to replace the xml file (@WebServlet, etc.)

More information is given in this thread : How to use annotations instead of web.xml in the servlet to specify url

Community
  • 1
  • 1
Rouliboy
  • 1,377
  • 1
  • 8
  • 21