Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3356

MyFaces assumes that the WAR is exploded and XHTML pages are accessible in filesystem

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.9, 1.2.10, 2.0.9, 2.1.3
    • 2.0.10, 2.1.4
    • General
    • None

    Description

      During initialization, MyFaces assumes that the Web Application has been exploded in some location in the filesystem. This assumption is caused by heavily using ServletContext.getRealPath during initialization, as well as File objects to access xhtml pages.

      This makes MyFaces behave badly in containers which do not need to explode WARs, e.g. Apache Karaf with PAX Web. It also hinders OSGi-friendliness.

      I have pinpointed the following locations, at least:

      • org.apache.myfaces.config.FacesConfigValidator (line 102 in v2.1.3): when validating the from-id and to-id in the navigation rules.
      • org.apache.myfaces.webapp.AbstractFacesInitializer (line 320 in v2.1.3): when setting the context path for validations
      • org.apache.myfaces.webapp.AbstractFacesInitializer (line 133 in v2.1.3): logging

      It would be a good idea to refactor this code to use ServletContext.getResource, as naturally XHTML files are bound to be WAR resources anyway. This will also make MyFaces more implementation-agnostic.

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            raulvk Raúl Kripalani
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: