Sunday, July 17, 2016

Challenges faced on creating HelloWorld web application using Maven Eclipse Apache

1. Create a simple web application project using maven. Select proper maven archetype.(maven-archetype-webapp)
2.There were no src/main/java dir. So created one.
3. Placed all java and xml properly.

4. Challenge 1: In the Run As no Server option was coming.
Fix: Go to project properties and select the Dynamic Web project in the facets sections.






















In image you can see what to select.

5. Challenge 2: the web.xml file was not picked properly.
Fix is to change the Deployment Assembly properly. When you have modified the project facet to dynamic web module it creates a default WebContent folder inside your home folder.(not src). So this default location is configured in the Deployment Assembly. On the other hand maven created the web.xml files inside the src/main/webapp/ folder. So we need to add this location to correctly get the home page(index.jsp) just after server start.
































In the above picture you can see the correct Deployment Assembly.

Hope this guides you to deploy HelloWorld Spring MVC module successfully.

No comments:

Post a Comment