Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-8224

Servlet container should allow welcome file to be a servlet path (not just a physical file)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • None
    • 6.0.0.M3
    • Web (Tomcat) service
    • None
    • Hide

      Create an empty file that matches the name of the Servlet path to trick the Servlet container into forwarding to that path. For instance, to use index.jsf as the welcome page, create an empty file named index.jsf in the directory.

      Show
      Create an empty file that matches the name of the Servlet path to trick the Servlet container into forwarding to that path. For instance, to use index.jsf as the welcome page, create an empty file named index.jsf in the directory.

      It appears that the Servlet engine is looking for the existence of the welcome file in the web context before forwarding to it. This causes problems if you want to use a JSF view as your welcome file. In JSF, a translation occurs between the actual Servlet path and the view that gets rendered (the view ID). So if my welcome path is index.jsf, then the file is going to be index.xhtml (or whatever the default suffix is for JSF).

      The way I think it should work is that when the last welcome file is being processed, if that file cannot be located, assume it's a servlet path and just forward to it.

      (While I agree the concept of a welcome file should probably be rethought in the Servlet spec, GlassFish supports the requested feature and therefore we should offer it as "add-on" as well).

              rmaucher Remy Maucherat
              dan.j.allen Dan Allen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: