1 Reply Latest reply on May 11, 2008 3:41 PM by gejzir

    Cluster and context parameters

    gejzir

      Hi All,

      I have a JSF/facelets web application which works well in single server mode. Now I try to set up clustering, and I'm running into a problem.

      We have a PrettyUrlPhaseListener, which reads the URL mappings from the context parameters placed in the web.xml file.

      <context-param>
      <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
      <param-value>com.sun.facelets.FaceletViewHandler</param-value>
      </context-param>

      <context-param>
      <param-name>com.sun.faces.sandbox.urlPatterns</param-name>
      <param-value>
      ...
      URL mappings
      ...
      </param-value>
      </context-param>

      Deploying the war file under the "default" config in jboss 4.2.2 works fine, the phase listener reads the parameters from the web.xml using:

      FacesContext context;
      ...
      String patternInitParam = context.getExternalContext().getInitParameter(URL_PATTERNS_INIT_PARAM);

      The same war file deployed under the "all" configuration on the same jboss 4.2.2 application server sees no context parameters. Even the context.getExternalContext().getInitParameterMap() returns null.

      What am I missing here? Is it a clustering config issue or a tomcat config issue?
      Where do I have to set up context-parameters for web applications if not in the war packaged web.xml file?


      Thanks in advance:
      Gejzir

        • 1. Re: Cluster and context parameters
          gejzir

          I've figured it out.

          We've been reading the context params from the getPhaseId() function of the PhaseListener. In the clustered "all" configuration context parameters are not initialized in the context by the time the getPhaseId() function runs. It seems that in the "default" configuration context parameters are initialized earlier.

          Solution: we're reading the context parameters later, in the beforePhase function.