Search code examples
websphere

servlet mapping is shown as the project name on the URL. do i need ibm-web-bnd.xmi?


I have created a servlet mapping as /reskilling in my Servlet class. When I run the application the url contains the project name instead. This is a WebSphere Web application which is part of my EAR project. Do i need ibm-web-bnd.xmi to fix this?

here's my web.xml

<display-name>HibernateReskillingWeb</display-name>
<servlet>
    <description>Paid Up Plan List</description>
    <display-name>PaidUpPlanServlet</display-name>
    <servlet-name>PaidUpPlanServlet</servlet-name>
    <servlet-class>za.co.test.PaidUpPlanServlet</servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>PaidUpPlanServlet</servlet-name>
    <url-pattern>/reskilling</url-pattern>
</servlet-mapping>

<welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
</welcome-file-list>

The erros information is shown below ...

    HTTP Error Code:   404


Error Message:JSPG0036E: Failed to find resource /HibernateReskillingWeb/views/PaidUpPlan.jsp

Root Cause:java.io.FileNotFoundException: JSPG0036E: Failed to find resource /HibernateReskillingWeb/views/PaidUpPlan.jsp   at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.findWrapper(AbstractJSPExtensionProcessor.java:395)...

Solution

  • What is the context root for this web application? From the error message it is HibernateReskillingWeb

    If you haven't done anything to the Context Root, the default value is the Dynamic Web project's name.

    You can see this value in the application.xml and you can change that to anything that you want.

    Is there a directory called views under which your JSPs are stored? That is where the Container is looking for your JSP.

    The servlet mapping (that you have shown) has got no role to play here as you are trying to access a JSP.

    HTH