Issue
I have created a maven project using -- maven-archetype-webapp in Eclipse IDE.
I was able to create and execute the index.jsp, but now I need to create a new servlet. But when I right click the project and select a new servlet (New->Other->Web->Servlet) I cannot see my maven project in the dropdown, hence I cannot create the servlet using the Eclipse IDE in my Maven project.
Can some one point out why this is happening. I am new to Maven.
Thank You,
Edit - My web.xml
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Application</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Solution
IF you are not able to create servlet from the menu. Check the following.
Check if Web.xml file is created by maven in the WEB-INF folder.
If not create it.Is the project shown as a Web Project Or Not?
Right Click On Project->Properties->Project Facets-> Check if Dynamic Web Module is selected or not.? Select it for making the project as a web project.
Answered By - Akhi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.