Reputation: 11
I can't seem to understand why I am getting a 404 error on my first web app. I think it's because the jsp page (first.jsp) isn't mapped in the glassfish-web.xml file. When I create jsp page how do I add it to the glassfish-web.xml?
Error with 404
glassfish-web.xml
Upvotes: 1
Views: 130
Reputation: 2265
Try something like this. You might need to tweak the url pattern and servlet name to fit your need. Notice that jsp files compile to a servlet
<servlet>
<servlet-name>FirstServlet</servlet-name>
<jsp-file>/first.jsp</jsp-file>
</servlet>
<!--mapping-->
<servlet-mapping>
<servlet-name>FirstServlet</servlet-name>
<url-pattern>/first/*</url-pattern>
</servlet-mapping>
Upvotes: 1