javaeetutorial
  1. javaeetutorial
  2. JAVAEETUTORIAL-203

rsvp example's welcome-file and Faces servlet mapping not being respected

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 7.0.1
    • Fix Version/s: 7.0.2
    • Component/s: examples
    • Labels:
      None

      Description

      In jaxrs/rsvp, we have the following web.xml file:

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
          <context-param>
              <param-name>javax.faces.PROJECT_STAGE</param-name>
              <param-value>Development</param-value>
          </context-param>
          <servlet>
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
          </servlet>
          <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>/faces/*</url-pattern>
          </servlet-mapping>
          <session-config>
              <session-timeout>
                  30
              </session-timeout>
          </session-config>
          <welcome-file-list>
              <welcome-file>faces/index.xhtml</welcome-file>
          </welcome-file-list>
      </web-app>
      

      However, if you go to the context root (say, http://localhost:8080/rsvp/) you get a 404 error. The welcome-file setting isn't being respected.

      If you change the Faces servlet mapping and welcome-file to:

          <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>*.xhtml</url-pattern>
          </servlet-mapping>
      ...
          <welcome-file-list>
              <welcome-file>index.xhtml</welcome-file>
          </welcome-file-list>
      

      You get nothing but 404 errors at any URL.

      After investigating, Ed Burns suspects a bug in the GlassFish 4 web container.

        Activity

        Ian Evans created issue -
        Ian Evans made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Ian Evans made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Fix Version/s 7.0.2 [ 16321 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Ian Evans
            Reporter:
            Ian Evans
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: