ajsingh
ajsingh

Reputation: 11

Issues running web app on glassfish

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 enter image description here glassfish-web.xml enter image description here

Upvotes: 1

Views: 130

Answers (1)

Yohannes Gebremariam
Yohannes Gebremariam

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

Related Questions