Menu

Naming of faces-config

Users
Felix
2006-11-07
2013-04-08
  • Felix

    Felix - 2006-11-07

    Hello,
    i get an FileNotFound error if i rename my faces-config to something other than "faces-config.xml". Can i somehow use another naming?

    Felix

     
    • Mike Kienenberger

      You can specify additional config files using this web.xml context-param.   I don't know if it's required by the spec that /WEB-INF/faces-config.xml exist, or if throwing that exception is an implementation decision.

      I generally define JSF behavior (enabling facelets or adffaces) in the /WEB-INF/faces-config.xml file, then define application-specific behavior in other config files, and I stick these other config files in a subdirectory.

      Contrived example below:

          <context-param>
              <param-name>javax.faces.CONFIG_FILES</param-name>
              <param-value>/WEB-INF/faces-config-global.xml,/WEB-INF/faces-config/faces-config-pages.xml</param-value>
              <description>
                  Comma separated list of URIs of (additional) faces config files, excluding /WEB-INF/faces-config.xml
                  (e.g. /WEB-INF/my-config.xml)
                  See JSF 1.0 PRD2, 10.3.2
              </description>
          </context-param>

       
    • Felix

      Felix - 2006-11-08

      I have several config files as well, including my renamed faces-config. When i start my application a "Faces config resource /WEB-INF/Faces-Config.xml not found" message and JSF isn't properly initialized... this behaviour only appeared since i used jsf-spring. If i use the default naming everythign works fine.

       
    • Felix

      Felix - 2006-11-08

      Ok, i removed the Faces-Config.xml from my javax.faces.CONFIG_FILES and renamed it to the standard naming... isn't worth any more effort ;) Thanks!

       
      • Thomas Jachmann

        Thomas Jachmann - 2006-11-08

        Actually, this should work, so if it doesn't it is a bug. It works in 4.0 which will be released in some days.

        Cheers, Thomas

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.