View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.myfaces.shared.config;
20  
21  
22  import java.util.logging.Level;
23  import java.util.logging.Logger;
24  import javax.faces.context.ExternalContext;
25  import javax.servlet.ServletContext;
26  
27  import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFWebConfigParam;
28  import org.apache.myfaces.shared.util.ClassUtils;
29  import org.apache.myfaces.shared.util.WebConfigParamUtils;
30  
31  /**
32   * Holds all configuration init parameters (from web.xml) that are independent
33   * from the core implementation. The parameters in this class are available to
34   * all shared, component and implementation classes.
35   * See RuntimeConfig for configuration infos that come from the faces-config
36   * files and are needed by the core implementation.
37   *
38   * MyfacesConfig is meant for components that implement some of the extended features
39   * of MyFaces. Anyhow, using the MyFaces JSF implementation is no precondition for using
40   * MyfacesConfig in custom components. Upon using another JSF implementation
41   * (or omitting the extended init parameters) all config properties will simply have
42   * their default values.
43   */
44  public class MyfacesConfig
45  {
46      private static final String APPLICATION_MAP_PARAM_NAME = MyfacesConfig.class.getName();
47  
48      /**
49       * Set the virtual path used to serve resources using tomahawk addResource API. Note ExtensionsFilter should
50       * be able to receive request on the prefix used here.
51       */
52      @JSFWebConfigParam(tags="tomahawk")
53      public static final String  INIT_PARAM_RESOURCE_VIRTUAL_PATH = "org.apache.myfaces.RESOURCE_VIRTUAL_PATH";
54      public static final String  INIT_PARAM_RESOURCE_VIRTUAL_PATH_DEFAULT = "/faces/myFacesExtensionResource";
55  
56      /**
57       * Deprecated: tomahawk specific param to detect javascript, but it is no longer valid anymore.
58       */
59      @JSFWebConfigParam(defaultValue="false", expectedValues="true, false, on, off, yes, no",since="1.1",
60              ignoreUpperLowerCase=true, deprecated=true, tags="tomahawk", group="render")
61      private static final String  INIT_PARAM_DETECT_JAVASCRIPT = "org.apache.myfaces.DETECT_JAVASCRIPT";
62      private static final boolean INIT_PARAM_DETECT_JAVASCRIPT_DEFAULT = false;
63  
64      /**
65       * If true, a javascript function will be rendered that is able to restore the 
66       * former vertical scroll on every request. Convenient feature if you have pages
67       * with long lists and you do not want the browser page to always jump to the top
68       * if you trigger a link or button action that stays on the same page.
69       * Default: "false"
70       */
71      @JSFWebConfigParam(defaultValue="false", expectedValues="true, false, on, off, yes, no",since="1.1", 
72              ignoreUpperLowerCase=true, tags="tomahawk")
73      private static final String  INIT_PARAM_AUTO_SCROLL = "org.apache.myfaces.AUTO_SCROLL";
74      private static final boolean INIT_PARAM_AUTO_SCROLL_DEFAULT = false;
75  
76      /**
77       * Tomahawk specific: A class implementing the
78       * org.apache.myfaces.shared.renderkit.html.util.AddResource
79       * interface. It is responsible to
80       * place scripts and css on the right position in your HTML document.
81       * Default: "org.apache.myfaces.shared.renderkit.html.util.DefaultAddResource"
82       * Follow the description on the MyFaces-Wiki-Performance page to enable
83       * StreamingAddResource instead of DefaultAddResource if you want to
84       * gain performance.
85       */
86      @JSFWebConfigParam(defaultValue="org.apache.myfaces. renderkit.html.util. DefaultAddResource",since="1.1",
87              desc="Tomahawk specific: Indicate the class responsible to place scripts and css using " +
88                   "tomahawk AddResource API", tags="tomahawk")
89      private static final String INIT_PARAM_ADD_RESOURCE_CLASS = "org.apache.myfaces.ADD_RESOURCE_CLASS";
90      private static final String INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT = 
91          "org.apache.myfaces.renderkit.html.util.DefaultAddResource";
92  
93      /**
94       * Tomahawk specific: A very common problem in configuring MyFaces-web-applications
95       * is that the Extensions-Filter is not configured at all
96       * or improperly configured. This parameter will check for a properly
97       * configured Extensions-Filter if it is needed by the web-app.
98       * In most cases this check will work just fine, there might be cases
99       * where an internal forward will bypass the Extensions-Filter and the check
100      * will not work. If this is the case, you can disable the check by setting
101      * this parameter to false.
102      * 
103      * In tomahawk for JSF 2.0 since version 1.1.11, this param is set by default to false, otherwise is true.
104      */
105     @JSFWebConfigParam(defaultValue="for JSF 2.0 since 1.1.11 false, otherwise true", 
106             expectedValues="true, false, on, off, yes, no",since="1.1", ignoreUpperLowerCase=true,
107             desc="Tomahawk specific: This parameter will check for a properly configured Extensions-Filter if " +
108                  "it is needed by the web-app.", tags="tomahawk")
109     private static final String  INIT_CHECK_EXTENSIONS_FILTER = "org.apache.myfaces.CHECK_EXTENSIONS_FILTER";
110     private static final boolean INIT_CHECK_EXTENSIONS_FILTER_DEFAULT = false;
111 
112     /**
113      * Tomahawk specific: Interpret "readonly" property as "disable" for select components like t:selectOneRow.
114      */
115     @JSFWebConfigParam(defaultValue="true", expectedValues="true, false, on, off, yes, no",since="1.1", 
116             ignoreUpperLowerCase=true, tags="tomahawk", group="render")
117     private static final String INIT_READONLY_AS_DISABLED_FOR_SELECT = 
118         "org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS";
119     private static final boolean INIT_READONLY_AS_DISABLED_FOR_SELECT_DEFAULT = true;
120 
121     /**
122      * Set the time in seconds that check for updates of web.xml and faces-config descriptors and 
123      * refresh the configuration.
124      * This param is valid only if project stage is not production. Set this param to 0 disable this feature.
125      */
126     @JSFWebConfigParam(defaultValue="2",since="1.1", classType="java.lang.Long")
127     public static final String INIT_PARAM_CONFIG_REFRESH_PERIOD = "org.apache.myfaces.CONFIG_REFRESH_PERIOD";
128     public static final long INIT_PARAM_CONFIG_REFRESH_PERIOD_DEFAULT = 2;
129 
130     /**
131      * Define if the input field that should store the state (javax.faces.ViewState) should render 
132      * id="javax.faces.ViewState".
133      * 
134      * JSF API 1.2 defines a "javax.faces.ViewState" client parameter, that must be rendered as both the "name"
135      * and the "id" attribute of the hidden input that is rendered for the purpose of state saving
136      * (see ResponseStateManager.VIEW_STATE_PARAM).
137      * Actually this causes duplicate id attributes and thus invalid XHTML pages when multiple forms are rendered on
138      * one page. With the org.apache.myfaces.RENDER_VIEWSTATE_ID context parameter you can tune this behaviour.
139      * <br/>Set it to
140      * <ul><li>true - to render JSF 1.2 compliant id attributes (that might cause invalid XHTML), or</li>
141      * <li>false - to omit rendering of the id attribute (which is only needed for very special 
142      * AJAX/Javascript components)</li></ul>
143      * Default value is: true (for backwards compatibility and JSF 1.2 compliancy) 
144      */
145     @JSFWebConfigParam(defaultValue="true", expectedValues="true, false, on, off, yes, no",since="1.1", 
146             ignoreUpperLowerCase=true, group="state")
147     private static final String  INIT_PARAM_RENDER_VIEWSTATE_ID = "org.apache.myfaces.RENDER_VIEWSTATE_ID";
148     private static final boolean INIT_PARAM_RENDER_VIEWSTATE_ID_DEFAULT = true;
149 
150     /**
151      * Use "&amp;amp;" entity instead a plain "&amp;" character within HTML.
152      * <p>W3C recommends to use the "&amp;amp;" entity instead of a plain "&amp;" character within HTML.
153      * This also applies to attribute values and thus to the "href" attribute of &lt;a&gt; elements as well.
154      * Even more, when XHTML is used as output the usage of plain "&amp;" characters is forbidden and would lead to
155      * invalid XML code.
156      * Therefore, since version 1.1.6 MyFaces renders the correct "&amp;amp;" entity for links.</p>
157      * <p>The init parameter
158      * org.apache.myfaces.STRICT_XHTML_LINKS makes it possible to restore the old behaviour and to make MyFaces
159      * "bug compatible" to the Sun RI which renders plain "&amp;" chars in links as well.</p>
160      * <p>
161      * See: <a href="http://www.w3.org/TR/html401/charset.html#h-5.3.2">HTML 4.01 Specification</a>
162      * See: <a href="http://issues.apache.org/jira/browse/MYFACES-1774">Jira: MYFACES-1774</a>
163      * </p>
164      */
165     @JSFWebConfigParam(defaultValue="true", expectedValues="true, false, on, off, yes, no",since="1.1.6", 
166             ignoreUpperLowerCase=true, group="render")
167     private static final String  INIT_PARAM_STRICT_XHTML_LINKS = "org.apache.myfaces.STRICT_XHTML_LINKS";
168     private static final boolean INIT_PARAM_STRICT_XHTML_LINKS_DEFAULT = true;
169     
170     /**
171      * This param renders the clear javascript on button necessary only for
172      * compatibility with hidden fields feature of myfaces. This is done 
173      * because jsf ri does not render javascript on onclick method for button,
174      * so myfaces should do this.
175      */
176     @JSFWebConfigParam(defaultValue="false", expectedValues="true, false, on, off, yes, no",since="1.2.3",
177             ignoreUpperLowerCase=true, group="render")
178     private static final String INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON = 
179         "org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON";
180     private static final boolean INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON_DEFAULT= false;
181 
182     /**
183      * This param renders hidden fields at the end of h:form for link params when h:commandLink + f:param is used,
184      * instead use javascript to create them. Set this param to true also enables 
185      * org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON 
186      * automatically to ensure consistency. This feature is required to support Windows Mobile 6, because in 
187      * this environment, document.createElement() and form.appendChild() javascript methods are not supported.
188      */
189     @JSFWebConfigParam(defaultValue="false", expectedValues="true, false, on, off, yes, no",since="1.2.9",
190             ignoreUpperLowerCase=true, group="render")
191     private static final String INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS = 
192         "org.apache.myfaces.RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS";
193     private static final boolean INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS_DEFAULT= false;
194     
195     /**
196      * Add a code that save the form before submit using a
197      * link (call to window.external.AutoCompleteSaveForm(form) ). It's a bug on IE.
198      */
199     @JSFWebConfigParam(defaultValue="false", expectedValues="true, false, on, off, yes, no",since="1.1",
200             ignoreUpperLowerCase=true, group="render")
201     private static final String INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE = "org.apache.myfaces.SAVE_FORM_SUBMIT_LINK_IE";
202     private static final boolean INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE_DEFAULT = false;
203     
204     /**
205      * Define an alternate class name that will be used to initialize MyFaces, instead the default 
206      * javax.faces.webapp.FacesServlet.
207      * 
208      * <p>This helps MyFaces to detect the mappings and other additional configuration used to setup the 
209      * environment, and prevent abort initialization if no FacesServlet config is detected.
210      * </p>
211      */
212     @JSFWebConfigParam(since="1.2.7")
213     private static final String INIT_PARAM_DELEGATE_FACES_SERVLET = "org.apache.myfaces.DELEGATE_FACES_SERVLET";
214 
215     /**
216      * Indicate if the facelet associated to the view should be reapplied when the view is refreshed.
217      *  Default mode is "auto".
218      * 
219      * <p>This param is only valid when partial state saving is on.
220      * If this is set as true, the tag-handlers are always reapplied before render view, like in facelets 1.1.x, 
221      * allowing c:if work correctly to "toggle" components based on a value changed on invoke application phase. 
222      * If the param is set as "auto", the implementation check if c:if, c:forEach, 
223      * c:choose and ui:include with src=ELExpression is used on the page and if that so, mark the view
224      * to be refreshed.</p> 
225      */
226     @JSFWebConfigParam(since="2.0", defaultValue="auto", expectedValues="true,false,auto", tags="performance", 
227             ignoreUpperLowerCase=true, group="state")
228     public final static String INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS = 
229         "org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS"; 
230     public final static String INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_DEFAULT = "auto";
231 
232     /**
233      * Enable or disable a special mode that enable full state for parent components containing c:if, c:forEach, 
234      * c:choose and ui:include with src=ELExpression. By default is disabled(false).
235      * 
236      * <p>This param is only valid when partial state saving is on.
237      * If this is set as true, parent components containing  c:if, c:forEach, 
238      * c:choose and ui:include with src=ELExpression are marked to be restored fully, so state
239      * is preserved between request.</p>
240      */
241     @JSFWebConfigParam(since="2.0", defaultValue="false", expectedValues="true, false, on, off, yes, no", 
242             tags="performance", ignoreUpperLowerCase=true, group="state")
243     public final static String INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE = 
244         "org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE";
245     public final static boolean INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE_DEFAULT = false;
246     
247     /**
248      * If set to <code>true</code>, tag library XML files and faces config XML files using schema 
249      * will be validated during application start up
250      */
251     @JSFWebConfigParam(since="2.0", expectedValues="true, false, on, off, yes, no", ignoreUpperLowerCase=true)
252     public final static String INIT_PARAM_VALIDATE_XML = "org.apache.myfaces.VALIDATE_XML";
253     public final static boolean INIT_PARAM_VALIDATE_XML_DEFAULT = false;
254     
255     /**
256      * Wrap content inside script with xml comment to prevent old browsers to display it. By default it is true. 
257      */
258     @JSFWebConfigParam(since="2.0.1", expectedValues="true, false, on, off, yes, no", defaultValue="false",
259             ignoreUpperLowerCase=true, group="render")
260     public final static String INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG = 
261         "org.apache.myfaces.WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG";
262     public final static boolean INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG_DEFAULT = false;
263     
264     /**
265      * Enable/disable DebugPhaseListener feature, with provide useful information about ValueHolder 
266      * variables (submittedValue, localValue, value).
267      * Note evaluate those getters for each component could cause some unwanted side effects when 
268      * using "access" type scopes like on MyFaces CODI.
269      * This param only has effect when project stage is Development.     
270      */
271     @JSFWebConfigParam(since="2.0.8")
272     public final static String INIT_PARAM_DEBUG_PHASE_LISTENER = "org.apache.myfaces.DEBUG_PHASE_LISTENER";
273     public final static boolean INIT_PARAM_DEBUG_PHASE_LISTENER_DEFAULT = false;
274     
275     /**
276      * Change default getType() behavior for composite component EL resolver, from return null 
277      * (see JSF 2_0 spec section 5_6_2_2) to
278      * use the metadata information added by composite:attribute, ensuring components working with 
279      * chained EL expressions to find the
280      * right type when a getType() is called over the source EL expression.
281      * 
282      * To ensure strict compatibility with the spec set this param to true (by default is false, 
283      * so the change is enabled by default). 
284      */
285     @JSFWebConfigParam(since="2.0.10", expectedValues="true, false", defaultValue="false", group="EL")
286     public final static String INIT_PARAM_STRICT_JSF_2_CC_EL_RESOLVER = 
287         "org.apache.myfaces.STRICT_JSF_2_CC_EL_RESOLVER";
288     public final static boolean INIT_PARAM_STRICT_JSF_2_CC_EL_RESOLVER_DEFAULT = false;
289     
290     /**
291      * Define the default content type that the default ResponseWriter generates, when no match can be derived from
292      * HTTP Accept Header.
293      */
294     @JSFWebConfigParam(since="2.0.11,2.1.5", expectedValues="text/html, application/xhtml+xml", 
295             defaultValue="text/html", group="render")
296     public final static String INIT_PARAM_DEFAULT_RESPONSE_WRITER_CONTENT_TYPE_MODE = 
297         "org.apache.myfaces.DEFAULT_RESPONSE_WRITER_CONTENT_TYPE_MODE";
298     public final static String INIT_PARAM_DEFAULT_RESPONSE_WRITER_CONTENT_TYPE_MODE_DEFAULT = "text/html";
299 
300     /**
301      * Enable or disable a cache used to "remember" the generated facelets unique ids and reduce 
302      * the impact on memory usage, only active if javax.faces.FACELETS_REFRESH_PERIOD is -1 (no refresh).
303      */
304     @JSFWebConfigParam(defaultValue = "true", since = "2.0.13, 2.1.7", expectedValues="true, false", 
305             group="viewhandler", tags="performance",
306             desc="Enable or disable a cache used to 'remember'  the generated facelets unique ids " + 
307                  "and reduce the impact over memory usage.")
308     public static final String INIT_PARAM_VIEW_UNIQUE_IDS_CACHE_ENABLED = 
309         "org.apache.myfaces.VIEW_UNIQUE_IDS_CACHE_ENABLED";
310     public static final boolean INIT_PARAM_VIEW_UNIQUE_IDS_CACHE_ENABLED_DEFAULT = true;
311     
312     /**
313      * Set the size of the cache used to store strings generated using SectionUniqueIdCounter
314      * for component ids. If this is set to 0, no cache is used. By default is set to 100.
315      */
316     @JSFWebConfigParam(defaultValue = "100", since = "2.0.13, 2.1.7",
317             group="viewhandler", tags="performance")
318     public static final String INIT_PARAM_COMPONENT_UNIQUE_IDS_CACHE_SIZE =
319         "org.apache.myfaces.COMPONENT_UNIQUE_IDS_CACHE_SIZE";
320     public static final int INIT_PARAM_COMPONENT_UNIQUE_IDS_CACHE_SIZE_DEFAULT = 100;
321 
322     /**
323     * If set false, myfaces won't support JSP and javax.faces.el. JSP are deprecated in JSF 2.X, javax.faces.el in 
324     * in JSF 1.2. Default value is true. 
325     * 
326     * If this property is set is false, JSF 1.1 VariableResolver and PropertyResolver config (replaced in JSF 1.2 by
327     * ELResolver) and all related logic for JSP is skipped, making EL evaluation faster.  
328     */
329     @JSFWebConfigParam(since="2.0.13,2.1.7", expectedValues="true,false", defaultValue="true",
330          desc="If set false, myfaces won't support JSP and javax.faces.el. JSP are deprecated in " +
331          "JSF 2.X, javax.faces.el in in JSF 1.2. Default value is true.",
332          group="EL", tags="performance ")
333     public final static String INIT_PARAM_SUPPORT_JSP_AND_FACES_EL = "org.apache.myfaces.SUPPORT_JSP_AND_FACES_EL";
334     public final static boolean INIT_PARAM_SUPPORT_JSP_AND_FACES_EL_DEFAULT = true;
335     
336     @JSFWebConfigParam(since = "2.3", expectedValues="true,false", defaultValue="true",
337          desc="If set false, myfaces won't support ManagedBeans anymore. ManagedBeans are deprecated in " +
338          "JSF 2.3, Default value is true.",
339          group="EL", tags="performance ")
340     public static final String INIT_PARAM_SUPPORT_MANAGED_BEANS = "org.apache.myfaces.SUPPORT_MANAGED_BEANS";
341     public final static boolean INIT_PARAM_SUPPORT_MANAGED_BEANS_DEFAULT = true;
342     
343     /**
344      * When the application runs inside Google Application Engine container (GAE),
345      * indicate which jar files should be scanned for files (faces-config, facelets taglib
346      * or annotations). It accept simple wildcard patterns like myfavoritejsflib-*.jar or 
347      * myfavoritejsflib-1.1.?.jar. By default, all the classpath is scanned for files 
348      * annotations (so it adds an small delay on startup).
349      */
350     @JSFWebConfigParam(since = "2.1.8, 2.0.14", expectedValues="none, myfavoritejsflib-*.jar",
351             tags="performance, GAE")
352     public static final String INIT_PARAM_GAE_JSF_JAR_FILES = "org.apache.myfaces.GAE_JSF_JAR_FILES";
353     public final static String INIT_PARAM_GAE_JSF_JAR_FILES_DEFAULT = null;
354 
355     /**
356      * When the application runs inside Google Application Engine container (GAE),
357      * indicate which jar files should be scanned for annotations. This param overrides
358      * org.apache.myfaces.GAE_JSF_JAR_FILES behavior that tries to find faces-config.xml or
359      * files ending with .faces-config.xml in /META-INF folder and if that so, try to
360      * find JSF annotations in the whole jar file. It accept simple wildcard patterns 
361      * like myfavoritejsflib-*.jar or myfavoritejsflib-1.1.?.jar.
362      * By default, all the classpath is scanned for annotations (so it adds an small
363      * delay on startup).
364      */
365     @JSFWebConfigParam(since = "2.1.8, 2.0.14", expectedValues="none, myfavoritejsflib-*.jar",
366             tags="performance, GAE")
367     public static final String INIT_PARAM_GAE_JSF_ANNOTATIONS_JAR_FILES = 
368             "org.apache.myfaces.GAE_JSF_ANNOTATIONS_JAR_FILES";
369     public final static String INIT_PARAM_GAE_JSF_ANNOTATIONS_JAR_FILES_DEFAULT = null;
370     
371     /**
372      * If this param is set to true, a check will be done in Restore View Phase to check
373      * if the viewId exists or not and if it does not exists, a 404 response will be thrown.
374      * 
375      * This is applicable in cases where all the views in the application are generated by a 
376      * ViewDeclarationLanguage implementation.
377      */
378     @JSFWebConfigParam(since = "2.1.13", defaultValue="false", expectedValues="true,false", 
379             group="viewhandler")
380     public static final String INIT_PARAM_STRICT_JSF_2_VIEW_NOT_FOUND = 
381             "org.apache.myfaces.STRICT_JSF_2_VIEW_NOT_FOUND";
382     public final static boolean INIT_PARAM_STRICT_JSF_2_VIEW_NOT_FOUND_DEFAULT = false;
383 
384     @JSFWebConfigParam(defaultValue = "false", since = "2.2.0", expectedValues="true, false", group="render",
385             tags="performance",
386             desc="Enable or disable an early flush which allows to send e.g. the HTML-Head to the client " +
387                     "while the rest gets rendered. It's a well known technique to reduce the time for loading a page.")
388     private static final String INIT_PARAM_EARLY_FLUSH_ENABLED =
389         "org.apache.myfaces.EARLY_FLUSH_ENABLED";
390     private static final boolean INIT_PARAM_EARLY_FLUSH_ENABLED_DEFAULT = false;
391     
392     /**
393      * This param makes components like c:set, ui:param and templating components like ui:decorate,
394      * ui:composition and ui:include to behave like the ones provided originally in facelets 1_1_x. 
395      * See MYFACES-3810 for details.
396      */
397     @JSFWebConfigParam(since = "2.2.0", defaultValue="false", expectedValues="true,false", 
398             group="viewhandler")
399     public static final String INIT_PARAM_STRICT_JSF_2_FACELETS_COMPATIBILITY = 
400             "org.apache.myfaces.STRICT_JSF_2_FACELETS_COMPATIBILITY";
401     public final static boolean INIT_PARAM_STRICT_JSF_2_FACELETS_COMPATIBILITY_DEFAULT = false;    
402     
403     /**
404      * This param makes h:form component to render the view state and other hidden fields
405      * at the beginning of the form. This also includes component resources with target="form",
406      * but it does not include legacy 1.1 myfaces specific hidden field adition.
407      */
408     @JSFWebConfigParam(since = "2.2.4", defaultValue = "false", expectedValues = "true,false",
409             group="render")
410     public static final String INIT_PARAM_RENDER_FORM_VIEW_STATE_AT_BEGIN =
411             "org.apache.myfaces.RENDER_FORM_VIEW_STATE_AT_BEGIN";
412     public final static boolean INIT_PARAM_RENDER_FORM_VIEW_STATE_AT_BEGIN_DEFAULT = false;
413     
414     /**
415      * Defines whether flash scope is disabled, preventing add the Flash cookie to the response. 
416      * 
417      * <p>This is useful for applications that does not require to use flash scope, and instead uses other scopes.</p>
418      */
419     @JSFWebConfigParam(defaultValue="false",since="2.0.5")
420     public static final String INIT_PARAM_FLASH_SCOPE_DISABLED = "org.apache.myfaces.FLASH_SCOPE_DISABLED";
421     public static final boolean INIT_PARAM_FLASH_SCOPE_DISABLED_DEFAULT = false;
422     
423     /**
424      * Defines the amount (default = 20) of the latest views are stored in session.
425      * 
426      * <p>Only applicable if state saving method is "server" (= default).
427      * </p>
428      * 
429      */
430     @JSFWebConfigParam(defaultValue="20",since="1.1", classType="java.lang.Integer", group="state", tags="performance")
431     public static final String INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION = "org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION";
432 
433     /**
434      * Default value for <code>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION</code> context parameter.
435      */
436     public static final int INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION_DEFAULT = 20;    
437 
438     /**
439      * Indicates the amount of views (default is not active) that should be stored in session between sequential
440      * POST or POST-REDIRECT-GET if org.apache.myfaces.USE_FLASH_SCOPE_PURGE_VIEWS_IN_SESSION is true.
441      * 
442      * <p>Only applicable if state saving method is "server" (= default). For example, if this param has value = 2 and 
443      * in your custom webapp there is a form that is clicked 3 times, only 2 views
444      * will be stored and the third one (the one stored the first time) will be
445      * removed from session, even if the view can
446      * store more sessions org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION.
447      * This feature becomes useful for multi-window applications.
448      * where without this feature a window can swallow all view slots so
449      * the other ones will throw ViewExpiredException.</p>
450      */
451     @JSFWebConfigParam(since="2.0.6", classType="java.lang.Integer", group="state", tags="performance", 
452             defaultValue = "4")
453     public static final String INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION
454             = "org.apache.myfaces.NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION";
455     public static final Integer INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION_DEFAULT = 4;
456     
457     /**
458      * Indicate the max number of flash tokens stored into session. It is only active when 
459      * javax.faces.CLIENT_WINDOW_MODE is enabled and javax.faces.STATE_SAVING_METHOD is set
460      * to "server". Each flash token is associated to one client window id at
461      * the same time, so this param is related to the limit of active client windows per session. 
462      * By default is the same number as in 
463      * (org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION / 
464      * org.apache.myfaces.NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION) + 1 = 6.
465      */
466     @JSFWebConfigParam(since="2.2.6", group="state", tags="performance")
467     static final String INIT_PARAM_NUMBER_OF_FLASH_TOKENS_IN_SESSION = 
468             "org.apache.myfaces.NUMBER_OF_FLASH_TOKENS_IN_SESSION";
469     
470     /**
471      * Indicate the max number of client window ids stored into session by faces flow. It is only active when 
472      * javax.faces.CLIENT_WINDOW_MODE is enabled and javax.faces.STATE_SAVING_METHOD is set
473      * to "server". This param is related to the limit of active client 
474      * windows per session, and it is used to cleanup flow scope beans when a client window or view becomes 
475      * invalid. 
476      * By default is the same number as in 
477      * (org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION / 
478      * org.apache.myfaces.NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION) + 1 = 6.
479      */
480     @JSFWebConfigParam(since="2.2.6", group="state", tags="performance")
481     static final String INIT_PARAM_NUMBER_OF_FACES_FLOW_CLIENT_WINDOW_IDS_IN_SESSION = 
482             "org.apache.myfaces.FACES_FLOW_CLIENT_WINDOW_IDS_IN_SESSION";
483     
484     /**
485      * This parameter specifies whether or not the ImportHandler will be supported
486      */
487     @JSFWebConfigParam(since="2.2.9", defaultValue="false", expectedValues="true,false", group="EL")
488     protected static final String SUPPORT_EL_3_IMPORT_HANDLER = "org.apache.myfaces.SUPPORT_EL_3_IMPORT_HANDLER";
489     public final static boolean SUPPORT_EL_3_IMPORT_HANDLER_DEFAULT = false;
490 
491     /**
492      * This parameter specifies whether or not the Origin header app path should be checked 
493      */
494     @JSFWebConfigParam(since="2.3", defaultValue="false", expectedValues="true,false")
495     protected static final String STRICT_JSF_2_ORIGIN_HEADER_APP_PATH = 
496             "org.apache.myfaces.STRICT_JSF_2_ORIGIN_HEADER_APP_PATH";
497     public final static boolean STRICT_JSF_2_ORIGIN_HEADER_APP_PATH_DEFAULT = false;
498 
499     /**
500      * Defines if a session should be created (if one does not exist) before response rendering.
501      * When this parameter is set to true, a session will be created even when client side state 
502      * saving or stateless views are used, which can lead to unintended resource consumption.
503      * When this parameter is set to false, a session will only be created before response 
504      * rendering if a view is not transient and server side state saving is in use.
505      */
506     @JSFWebConfigParam(since="2.3.6", defaultValue="true", expectedValues="true,false")
507     protected static final String ALWAYS_FORCE_SESSION_CREATION = 
508             "org.apache.myfaces.ALWAYS_FORCE_SESSION_CREATION";
509     public final static boolean ALWAYS_FORCE_SESSION_CREATION_DEFAULT = true;
510 
511     private boolean _detectJavascript;
512     private boolean _autoScroll;
513     private String _addResourceClass;
514     private String _resourceVirtualPath;
515     private boolean _checkExtensionsFilter;
516     private boolean _readonlyAsDisabledForSelect;
517     private long _configRefreshPeriod;
518     private boolean _renderViewStateId;
519     private boolean _strictXhtmlLinks;
520     private boolean _renderClearJavascriptOnButton;
521     private boolean renderHiddenFieldsForLinkParams;
522     private boolean _saveFormSubmitLinkIE;
523     private String _delegateFacesServlet;
524     private boolean _refreshTransientBuildOnPSS;
525     private boolean _refreshTransientBuildOnPSSAuto;
526     private boolean refreshTransientBuildOnPSSPreserveState;
527     private boolean _validateXML;
528     private boolean _wrapScriptContentWithXmlCommentTag;
529     private boolean _debugPhaseListenerEnabled;
530     private boolean _strictJsf2CCELResolver;
531     private String _defaultResponseWriterContentTypeMode;
532     private boolean _viewUniqueIdsCacheEnabled;
533     private int _componentUniqueIdsCacheSize;
534     private boolean _supportJSPAndFacesEL;
535     private boolean _supportManagedBeans;
536     private String _gaeJsfJarFiles;
537     private String _gaeJsfAnnotationsJarFiles;
538     private boolean _strictJsf2ViewNotFound;
539     private boolean _earlyFlushEnabled;
540     private boolean _strictJsf2FaceletsCompatibility;
541     private boolean _renderFormViewStateAtBegin;
542     private boolean _flashScopeDisabled;
543     private Integer _numberOfViewsInSession;
544     private Integer _numberOfSequentialViewsInSession;
545     private Integer _numberOfFlashTokensInSession;
546     private Integer _numberOfFacesFlowClientWindowIdsInSession;
547     private boolean _supportEL3ImportHandler;
548     private boolean _strictJsf2OriginHeaderAppPath;
549     private boolean _alwaysForceSessionCreation;
550 
551     private static final boolean TOMAHAWK_AVAILABLE;
552     private static final boolean MYFACES_IMPL_AVAILABLE;
553     private static final boolean RI_IMPL_AVAILABLE;
554 
555     static
556     {
557         boolean tomahawkAvailable;
558         try
559         {
560             ClassUtils.classForName("org.apache.myfaces.webapp.filter.ExtensionsFilter");
561             tomahawkAvailable = true;
562         }
563         catch (ClassNotFoundException e)
564         {
565             tomahawkAvailable = false;
566         }
567         TOMAHAWK_AVAILABLE = tomahawkAvailable;
568     }
569 
570     static
571     {
572         boolean myfacesImplAvailable;
573         try
574         {
575             ClassUtils.classForName("org.apache.myfaces.application.ApplicationImpl");
576             myfacesImplAvailable = true;
577         }
578         catch (ClassNotFoundException e)
579         {
580             myfacesImplAvailable = false;
581         }
582         MYFACES_IMPL_AVAILABLE = myfacesImplAvailable;
583     }
584 
585     static
586     {
587         boolean riImplAvailable;
588         try
589         {
590             ClassUtils.classForName("com.sun.faces.application.ApplicationImpl");
591             riImplAvailable = true;
592         }
593         catch (ClassNotFoundException e)
594         {
595             riImplAvailable = false;
596         }
597         RI_IMPL_AVAILABLE = riImplAvailable;
598     }
599 
600     public static MyfacesConfig getCurrentInstance(ExternalContext extCtx)
601     {
602         MyfacesConfig myfacesConfig = (MyfacesConfig) extCtx
603                 .getApplicationMap().get(APPLICATION_MAP_PARAM_NAME);
604         if (myfacesConfig == null)
605         {
606 
607             myfacesConfig = createAndInitializeMyFacesConfig(extCtx);
608 
609             extCtx.getApplicationMap().put(APPLICATION_MAP_PARAM_NAME, myfacesConfig);
610 
611         }
612 
613         return myfacesConfig;
614     }
615     
616     public MyfacesConfig()
617     {
618         setRenderClearJavascriptOnButton(INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON_DEFAULT);
619         setRenderHiddenFieldsForLinkParams(INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS_DEFAULT);
620         setSaveFormSubmitLinkIE(INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE_DEFAULT);
621         setReadonlyAsDisabledForSelect(INIT_READONLY_AS_DISABLED_FOR_SELECT_DEFAULT);
622         setRenderViewStateId(INIT_PARAM_RENDER_VIEWSTATE_ID_DEFAULT);
623         setStrictXhtmlLinks(INIT_PARAM_STRICT_XHTML_LINKS_DEFAULT);
624         setConfigRefreshPeriod(INIT_PARAM_CONFIG_REFRESH_PERIOD_DEFAULT);           
625         setRefreshTransientBuildOnPSS(true);
626         setRefreshTransientBuildOnPSSAuto(true);
627         setRefreshTransientBuildOnPSSPreserveState(INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE_DEFAULT);
628         setValidateXML(INIT_PARAM_VALIDATE_XML_DEFAULT);
629         setWrapScriptContentWithXmlCommentTag(INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG_DEFAULT);
630         setDetectJavascript(INIT_PARAM_DETECT_JAVASCRIPT_DEFAULT);
631         setAutoScroll(INIT_PARAM_AUTO_SCROLL_DEFAULT);
632         setAddResourceClass(INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT);
633         setResourceVirtualPath(INIT_PARAM_RESOURCE_VIRTUAL_PATH_DEFAULT);
634         //The default is true but we'll let it false because it depends if 
635         //tomahawk is on classpath and no test environment is set
636         setCheckExtensionsFilter(false);
637         setDebugPhaseListenerEnabled(INIT_PARAM_DEBUG_PHASE_LISTENER_DEFAULT);
638         setStrictJsf2CCELResolver(INIT_PARAM_STRICT_JSF_2_CC_EL_RESOLVER_DEFAULT);
639         setDefaultResponseWriterContentTypeMode(INIT_PARAM_DEFAULT_RESPONSE_WRITER_CONTENT_TYPE_MODE_DEFAULT);
640         setViewUniqueIdsCacheEnabled(INIT_PARAM_VIEW_UNIQUE_IDS_CACHE_ENABLED_DEFAULT);
641         setComponentUniqueIdsCacheSize(INIT_PARAM_COMPONENT_UNIQUE_IDS_CACHE_SIZE_DEFAULT);
642         setSupportJSPAndFacesEL(INIT_PARAM_SUPPORT_JSP_AND_FACES_EL_DEFAULT);
643         setSupportManagedBeans(INIT_PARAM_SUPPORT_MANAGED_BEANS_DEFAULT);
644         setGaeJsfJarFiles(INIT_PARAM_GAE_JSF_JAR_FILES_DEFAULT);
645         setGaeJsfAnnotationsJarFiles(INIT_PARAM_GAE_JSF_ANNOTATIONS_JAR_FILES_DEFAULT);
646         setStrictJsf2ViewNotFound(INIT_PARAM_STRICT_JSF_2_VIEW_NOT_FOUND_DEFAULT);
647         setEarlyFlushEnabled(INIT_PARAM_EARLY_FLUSH_ENABLED_DEFAULT);
648         setStrictJsf2FaceletsCompatibility(INIT_PARAM_STRICT_JSF_2_FACELETS_COMPATIBILITY_DEFAULT);
649         setRenderFormViewStateAtBegin(INIT_PARAM_RENDER_FORM_VIEW_STATE_AT_BEGIN_DEFAULT);
650         setFlashScopeDisabled(INIT_PARAM_FLASH_SCOPE_DISABLED_DEFAULT);
651         setNumberOfViewsInSession(INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION_DEFAULT);
652         setNumberOfSequentialViewsInSession(INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION_DEFAULT);
653         setNumberOfFlashTokensInSession(
654                 (INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION_DEFAULT / 
655                         INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION_DEFAULT)+1);
656         setSupportEL3ImportHandler(SUPPORT_EL_3_IMPORT_HANDLER_DEFAULT);
657         setStrictJsf2OriginHeaderAppPath(STRICT_JSF_2_ORIGIN_HEADER_APP_PATH_DEFAULT);
658         setAlwaysForceSessionCreation(ALWAYS_FORCE_SESSION_CREATION_DEFAULT);
659     }
660 
661     private static MyfacesConfig createAndInitializeMyFacesConfig(ExternalContext extCtx)
662     {
663         
664         MyfacesConfig myfacesConfig = new MyfacesConfig();
665 
666         myfacesConfig.setRenderClearJavascriptOnButton(getBooleanInitParameter(extCtx, 
667                                                             INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON,
668                                                             INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON_DEFAULT));
669 
670         myfacesConfig.setRenderHiddenFieldsForLinkParams(getBooleanInitParameter(extCtx, 
671                 INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS,
672                 INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS_DEFAULT));
673 
674         myfacesConfig.setSaveFormSubmitLinkIE(getBooleanInitParameter(extCtx, INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE,
675                                                             INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE_DEFAULT));
676         
677         myfacesConfig.setReadonlyAsDisabledForSelect(getBooleanInitParameter(extCtx, 
678                                                                  INIT_READONLY_AS_DISABLED_FOR_SELECT,
679                                                                  INIT_READONLY_AS_DISABLED_FOR_SELECT_DEFAULT));
680         myfacesConfig.setRenderViewStateId(getBooleanInitParameter(extCtx, INIT_PARAM_RENDER_VIEWSTATE_ID,
681                                                                    INIT_PARAM_RENDER_VIEWSTATE_ID_DEFAULT));
682         myfacesConfig.setStrictXhtmlLinks(getBooleanInitParameter(extCtx, INIT_PARAM_STRICT_XHTML_LINKS,
683                                                                   INIT_PARAM_STRICT_XHTML_LINKS_DEFAULT));
684         
685         myfacesConfig.setConfigRefreshPeriod(getLongInitParameter(extCtx, INIT_PARAM_CONFIG_REFRESH_PERIOD,
686                 INIT_PARAM_CONFIG_REFRESH_PERIOD_DEFAULT));
687 
688 
689         myfacesConfig.setDelegateFacesServlet(extCtx.getInitParameter(INIT_PARAM_DELEGATE_FACES_SERVLET));
690         
691         String refreshTransientBuildOnPSS = getStringInitParameter(extCtx, 
692                 INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS, 
693                 INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_DEFAULT);
694         
695         if (refreshTransientBuildOnPSS == null)
696         {
697             myfacesConfig.setRefreshTransientBuildOnPSS(false);
698             myfacesConfig.setRefreshTransientBuildOnPSSAuto(false);
699         }
700         else if ("auto".equalsIgnoreCase(refreshTransientBuildOnPSS))
701         {
702             myfacesConfig.setRefreshTransientBuildOnPSS(true);
703             myfacesConfig.setRefreshTransientBuildOnPSSAuto(true);
704         }
705         else if (refreshTransientBuildOnPSS.equalsIgnoreCase("true") || 
706                 refreshTransientBuildOnPSS.equalsIgnoreCase("on") || 
707                 refreshTransientBuildOnPSS.equalsIgnoreCase("yes"))
708         {
709             myfacesConfig.setRefreshTransientBuildOnPSS(true);
710             myfacesConfig.setRefreshTransientBuildOnPSSAuto(false);
711         }
712         else
713         {
714             myfacesConfig.setRefreshTransientBuildOnPSS(false);
715             myfacesConfig.setRefreshTransientBuildOnPSSAuto(false);
716         }
717         
718         myfacesConfig.setRefreshTransientBuildOnPSSPreserveState(getBooleanInitParameter(extCtx,
719                 INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE, 
720                 INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE_DEFAULT));
721         
722         myfacesConfig.setValidateXML(getBooleanInitParameter(extCtx, INIT_PARAM_VALIDATE_XML, 
723                 INIT_PARAM_VALIDATE_XML_DEFAULT));
724         
725         myfacesConfig.setWrapScriptContentWithXmlCommentTag(getBooleanInitParameter(extCtx, 
726                 INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG, 
727                 INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG_DEFAULT));
728         
729         myfacesConfig.setDebugPhaseListenerEnabled(getBooleanInitParameter(extCtx, INIT_PARAM_DEBUG_PHASE_LISTENER,
730                 INIT_PARAM_DEBUG_PHASE_LISTENER_DEFAULT));
731                 
732         myfacesConfig.setStrictJsf2CCELResolver(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
733                 INIT_PARAM_STRICT_JSF_2_CC_EL_RESOLVER, INIT_PARAM_STRICT_JSF_2_CC_EL_RESOLVER_DEFAULT));
734         
735         myfacesConfig.setDefaultResponseWriterContentTypeMode(WebConfigParamUtils.getStringInitParameter(
736                 extCtx, INIT_PARAM_DEFAULT_RESPONSE_WRITER_CONTENT_TYPE_MODE,
737                 INIT_PARAM_DEFAULT_RESPONSE_WRITER_CONTENT_TYPE_MODE_DEFAULT));
738 
739         myfacesConfig.setViewUniqueIdsCacheEnabled(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
740                 INIT_PARAM_VIEW_UNIQUE_IDS_CACHE_ENABLED, INIT_PARAM_VIEW_UNIQUE_IDS_CACHE_ENABLED_DEFAULT));
741         myfacesConfig.setComponentUniqueIdsCacheSize(
742                 WebConfigParamUtils.getIntegerInitParameter(extCtx,
743                 INIT_PARAM_COMPONENT_UNIQUE_IDS_CACHE_SIZE, 
744                 INIT_PARAM_COMPONENT_UNIQUE_IDS_CACHE_SIZE_DEFAULT));
745         myfacesConfig.setSupportJSPAndFacesEL(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
746                 INIT_PARAM_SUPPORT_JSP_AND_FACES_EL, INIT_PARAM_SUPPORT_JSP_AND_FACES_EL_DEFAULT));
747         
748         myfacesConfig.setSupportManagedBeans(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
749                 INIT_PARAM_SUPPORT_MANAGED_BEANS, INIT_PARAM_SUPPORT_MANAGED_BEANS_DEFAULT));
750         
751         myfacesConfig.setGaeJsfJarFiles(WebConfigParamUtils.getStringInitParameter(extCtx, 
752                 INIT_PARAM_GAE_JSF_JAR_FILES, INIT_PARAM_GAE_JSF_JAR_FILES_DEFAULT));
753         myfacesConfig.setGaeJsfAnnotationsJarFiles(WebConfigParamUtils.getStringInitParameter(extCtx, 
754                 INIT_PARAM_GAE_JSF_ANNOTATIONS_JAR_FILES, INIT_PARAM_GAE_JSF_ANNOTATIONS_JAR_FILES_DEFAULT));
755 
756         myfacesConfig.setStrictJsf2ViewNotFound(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
757                 INIT_PARAM_STRICT_JSF_2_VIEW_NOT_FOUND, INIT_PARAM_STRICT_JSF_2_VIEW_NOT_FOUND_DEFAULT));
758         
759         myfacesConfig.setEarlyFlushEnabled(WebConfigParamUtils.getBooleanInitParameter(extCtx,
760                 INIT_PARAM_EARLY_FLUSH_ENABLED, INIT_PARAM_EARLY_FLUSH_ENABLED_DEFAULT));
761 
762 
763         myfacesConfig.setStrictJsf2FaceletsCompatibility(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
764                 INIT_PARAM_STRICT_JSF_2_FACELETS_COMPATIBILITY, 
765                 INIT_PARAM_STRICT_JSF_2_FACELETS_COMPATIBILITY_DEFAULT));
766         
767         myfacesConfig.setRenderFormViewStateAtBegin(WebConfigParamUtils.getBooleanInitParameter(extCtx,
768                 INIT_PARAM_RENDER_FORM_VIEW_STATE_AT_BEGIN,
769                 INIT_PARAM_RENDER_FORM_VIEW_STATE_AT_BEGIN_DEFAULT));
770         
771         myfacesConfig.setFlashScopeDisabled(WebConfigParamUtils.getBooleanInitParameter(extCtx,
772                 INIT_PARAM_FLASH_SCOPE_DISABLED,
773                 INIT_PARAM_FLASH_SCOPE_DISABLED_DEFAULT));
774         
775         try
776         {
777             myfacesConfig.setNumberOfSequentialViewsInSession(WebConfigParamUtils.getIntegerInitParameter(
778                     extCtx, 
779                     INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION,
780                     INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION_DEFAULT));
781             Integer views = myfacesConfig.getNumberOfSequentialViewsInSession();
782             if (views == null || views < 0)
783             {
784                 Logger.getLogger(MyfacesConfig.class.getName()).severe(
785                         "Configured value for " + INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION
786                           + " is not valid, must be an value >= 0, using default value ("
787                           + INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION_DEFAULT);
788                 views = INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION_DEFAULT;
789             }
790         }
791         catch (Throwable e)
792         {
793             Logger.getLogger(MyfacesConfig.class.getName()).log(Level.SEVERE, "Error determining the value for "
794                    + INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION
795                    + ", expected an integer value > 0, using default value ("
796                    + INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION_DEFAULT + "): " + e.getMessage(), e);
797         }        
798         try
799         {
800             myfacesConfig.setNumberOfViewsInSession(WebConfigParamUtils.getIntegerInitParameter(
801                         extCtx, 
802                         INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION,
803                         INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION_DEFAULT));
804             Integer views = myfacesConfig.getNumberOfViewsInSession();
805             if (views == null || views <= 0)
806             {
807                 Logger.getLogger(MyfacesConfig.class.getName()).severe(
808                         "Configured value for " + INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION
809                           + " is not valid, must be an value > 0, using default value ("
810                           + INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION_DEFAULT);
811                 views = INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION_DEFAULT;
812             }
813         }
814         catch (Throwable e)
815         {
816             Logger.getLogger(MyfacesConfig.class.getName()).log(Level.SEVERE, "Error determining the value for "
817                    + INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION
818                    + ", expected an integer value > 0, using default value ("
819                    + INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION_DEFAULT + "): " + e.getMessage(), e);
820         }
821 
822         Integer numberOfFlashTokensInSessionDefault;
823         Integer i = myfacesConfig.getNumberOfSequentialViewsInSession();
824         int j = myfacesConfig.getNumberOfViewsInSession();
825         if (i != null && i.intValue() > 0)
826         {
827             numberOfFlashTokensInSessionDefault = (j / i.intValue()) + 1;
828         }
829         else
830         {
831             numberOfFlashTokensInSessionDefault = j + 1;
832         }
833         myfacesConfig.setNumberOfFlashTokensInSession(WebConfigParamUtils.getIntegerInitParameter(
834                         extCtx, 
835                         INIT_PARAM_NUMBER_OF_FLASH_TOKENS_IN_SESSION, numberOfFlashTokensInSessionDefault));
836         myfacesConfig.setNumberOfFacesFlowClientWindowIdsInSession(WebConfigParamUtils.getIntegerInitParameter(
837                         extCtx, 
838                         INIT_PARAM_NUMBER_OF_FACES_FLOW_CLIENT_WINDOW_IDS_IN_SESSION, 
839                         numberOfFlashTokensInSessionDefault));
840                         
841         myfacesConfig.setSupportEL3ImportHandler(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
842                        SUPPORT_EL_3_IMPORT_HANDLER, 
843                        SUPPORT_EL_3_IMPORT_HANDLER_DEFAULT)); 
844 
845         myfacesConfig.setStrictJsf2OriginHeaderAppPath(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
846                         STRICT_JSF_2_ORIGIN_HEADER_APP_PATH, 
847                         STRICT_JSF_2_ORIGIN_HEADER_APP_PATH_DEFAULT));
848 
849         myfacesConfig.setAlwaysForceSessionCreation(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
850                         ALWAYS_FORCE_SESSION_CREATION, 
851                         ALWAYS_FORCE_SESSION_CREATION_DEFAULT));
852         
853         if (TOMAHAWK_AVAILABLE)
854         {
855             myfacesConfig.setDetectJavascript(getBooleanInitParameter(extCtx, INIT_PARAM_DETECT_JAVASCRIPT,
856                     INIT_PARAM_DETECT_JAVASCRIPT_DEFAULT));
857             myfacesConfig.setAutoScroll(getBooleanInitParameter(extCtx, INIT_PARAM_AUTO_SCROLL,
858                     INIT_PARAM_AUTO_SCROLL_DEFAULT));
859                         
860             myfacesConfig.setAddResourceClass(getStringInitParameter(extCtx, INIT_PARAM_ADD_RESOURCE_CLASS,
861                     INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT));
862             myfacesConfig.setResourceVirtualPath(getStringInitParameter(extCtx, INIT_PARAM_RESOURCE_VIRTUAL_PATH,
863                     INIT_PARAM_RESOURCE_VIRTUAL_PATH_DEFAULT));
864 
865             myfacesConfig.setCheckExtensionsFilter(getBooleanInitParameter(extCtx, INIT_CHECK_EXTENSIONS_FILTER,
866                     INIT_CHECK_EXTENSIONS_FILTER_DEFAULT));
867             /*
868             if(RI_IMPL_AVAILABLE)
869             {
870                 if(log.isLoggable(Level.INFO))
871                 {
872                     log.info("Starting up Tomahawk on the RI-JSF-Implementation.");
873                 }
874             }
875 
876             if(MYFACES_IMPL_AVAILABLE)
877             {
878                 if(log.isLoggable(Level.INFO))
879                 {
880                     log.info("Starting up Tomahawk on the MyFaces-JSF-Implementation");
881                 }
882             }*/
883         }
884         /*
885         else
886         {
887             if (log.isLoggable(Level.INFO))
888             {
889                 log.info("Tomahawk jar not available. Autoscrolling, DetectJavascript, "+
890                 "AddResourceClass and CheckExtensionsFilter are disabled now.");
891             }
892         }*/
893 
894         /*
895         if(RI_IMPL_AVAILABLE && MYFACES_IMPL_AVAILABLE)
896         {
897             log.severe("Both MyFaces and the RI are on your classpath. Please make sure to"+
898             " use only one of the two JSF-implementations.");
899         }*/
900         return myfacesConfig;
901     }
902 
903     private static boolean getBooleanInitParameter(ExternalContext externalContext,
904                                                    String paramName,
905                                                    boolean defaultValue)
906     {
907         String strValue = externalContext.getInitParameter(paramName);
908         if (strValue == null)
909         {
910             //if (log.isLoggable(Level.INFO)) log.info("No context init parameter '" + 
911             // paramName + "' found, using default value " + defaultValue);
912             return defaultValue;
913         }
914         else if (strValue.equalsIgnoreCase("true") || strValue.equalsIgnoreCase("on") || 
915                 strValue.equalsIgnoreCase("yes"))
916         {
917             return true;
918         }
919         else if (strValue.equalsIgnoreCase("false") || strValue.equalsIgnoreCase("off") || 
920                 strValue.equalsIgnoreCase("no"))
921         {
922             return false;
923         }
924         else
925         {
926             //if (log.isLoggable(Level.WARNING)) log.warning("Wrong context init parameter '" + 
927             //paramName + "' (='" + strValue + "'), using default value " + defaultValue);
928             return defaultValue;
929         }
930     }
931 
932     private static String getStringInitParameter(ExternalContext externalContext,
933                                                  String paramName,
934                                                  String defaultValue)
935     {
936         String strValue = externalContext.getInitParameter(paramName);
937         if (strValue == null)
938         {
939             //if (log.isLoggable(Level.INFO)) log.info("No context init parameter '" + paramName +
940             //"' found, using default value " + defaultValue); //defaultValue==null should not be 
941             //a problem here
942             return defaultValue;
943         }
944         
945         return strValue;
946     }
947 
948     private static long getLongInitParameter(ExternalContext externalContext,
949                                                   String paramName,
950                                                   long defaultValue)
951     {
952        String strValue = externalContext.getInitParameter(paramName);
953        if (strValue == null)
954        {
955            //if (log.isLoggable(Level.INFO)) log.info("No context init parameter '" +paramName +
956            //"' found, using default value " +defaultValue);
957            return defaultValue;
958        }
959        else
960        {
961            try
962            {
963                return Long.parseLong(strValue);
964            }
965            catch (NumberFormatException e)
966            {
967                //if (log.isLoggable(Level.WARNING)) log.warning("Wrong context init parameter '" +
968                //paramName + "' (='" + strValue + "'), using default value " + defaultValue);
969            }
970            return defaultValue;
971        }
972     }
973         
974      private void setResourceVirtualPath( String resourceVirtualPath )
975      {
976          this._resourceVirtualPath = resourceVirtualPath;
977     }
978 
979      public String getResourceVirtualPath()
980      {
981          return this._resourceVirtualPath;
982      }
983 
984     public boolean isDetectJavascript()
985     {
986         return _detectJavascript;
987     }
988 
989     private void setDetectJavascript(boolean detectJavascript)
990     {
991         _detectJavascript = detectJavascript;
992     }
993 
994     private void setReadonlyAsDisabledForSelect(boolean readonlyAsDisabledForSelect)
995     {
996         _readonlyAsDisabledForSelect = readonlyAsDisabledForSelect;
997     }
998 
999     public boolean isReadonlyAsDisabledForSelect()
1000     {
1001         return _readonlyAsDisabledForSelect;
1002     }
1003 
1004 
1005    public long getConfigRefreshPeriod()
1006    {
1007        return _configRefreshPeriod;
1008    }
1009 
1010    public void setConfigRefreshPeriod(long configRefreshPeriod)
1011    {
1012        _configRefreshPeriod = configRefreshPeriod;
1013    }
1014 
1015     /**
1016      * JSF API 1.2 defines a "javax.faces.ViewState" client parameter, that must be rendered as both the "name"
1017      * and the "id" attribute of the hidden input that is rendered for the purpose of state saving
1018      * (see ResponseStateManager.VIEW_STATE_PARAM).
1019      * Actually this causes duplicate id attributes and thus invalid XHTML pages when multiple forms are rendered on
1020      * one page. With the {@link #INIT_PARAM_RENDER_VIEWSTATE_ID} context parameter you can tune this behaviour.
1021      * <p>Set it to:</p>
1022      * <ul><li>true - to render JSF 1.2 compliant id attributes (that might cause invalid XHTML), or</li>
1023      * <li>false - to omit rendering of the id attribute (which is only needed for very special AJAX/Javascript 
1024      * components)</li></ul>
1025      * <p>Default value is: true (for backwards compatibility and JSF 1.2 compliancy) </p>
1026      * @return true, if the client state hidden input "javax.faces.ViewState" id attribute should be rendered
1027      */
1028     public boolean isRenderViewStateId()
1029     {
1030         return _renderViewStateId;
1031     }
1032 
1033     public void setRenderViewStateId(boolean renderViewStateId)
1034     {
1035         _renderViewStateId = renderViewStateId;
1036     }
1037 
1038     /**
1039      * <p>W3C recommends to use the "&amp;amp;" entity instead of a plain "&amp;" character within HTML.
1040      * This also applies to attribute values and thus to the "href" attribute of &lt;a&gt; elements as well.
1041      * Even more, when XHTML is used as output the usage of plain "&amp;" characters is forbidden and would lead to
1042      * invalid XML code.
1043      * Therefore, since version 1.1.6 MyFaces renders the correct "&amp;amp;" entity for links.</p>
1044      * <p>The init parameter
1045      * {@link #INIT_PARAM_STRICT_XHTML_LINKS} makes it possible to restore the old behaviour and to make MyFaces
1046      * "bug compatible" to the Sun RI which renders plain "&amp;" chars in links as well.</p>
1047      * @see <a href="http://www.w3.org/TR/html401/charset.html#h-5.3.2">HTML 4.01 Specification</a>
1048      * @see <a href="http://issues.apache.org/jira/browse/MYFACES-1774">Jira: MYFACES-1774</a>
1049      * @return true if ampersand characters ("&amp;") should be correctly rendered as "&amp;amp;" entities 
1050      *         within link urls (=default), false for old (XHTML incompatible) behaviour
1051      */
1052     public boolean isStrictXhtmlLinks()
1053     {
1054         return _strictXhtmlLinks;
1055     }
1056 
1057     public void setStrictXhtmlLinks(boolean strictXhtmlLinks)
1058     {
1059         _strictXhtmlLinks = strictXhtmlLinks;
1060     }
1061 
1062     public boolean isTomahawkAvailable()
1063     {
1064         return TOMAHAWK_AVAILABLE;
1065     }
1066 
1067     public boolean isMyfacesImplAvailable()
1068     {
1069         return MYFACES_IMPL_AVAILABLE;
1070     }
1071 
1072     public boolean isRiImplAvailable()
1073     {
1074         return RI_IMPL_AVAILABLE;
1075     }
1076 
1077     public boolean isAutoScroll()
1078     {
1079         return _autoScroll;
1080     }
1081 
1082     private void setAutoScroll(boolean autoScroll)
1083     {
1084         _autoScroll = autoScroll;
1085     }
1086 
1087     private void setAddResourceClass(String addResourceClass)
1088     {
1089         _addResourceClass = addResourceClass;
1090     }
1091 
1092     public String getAddResourceClass()
1093     {
1094         return _addResourceClass;
1095     }
1096 
1097     /**
1098      * ExtensionFilter needs access to AddResourceClass init param without having
1099      * an ExternalContext at hand.
1100      */
1101     public static String getAddResourceClassFromServletContext(ServletContext servletContext)
1102     {
1103         String addResourceClass = servletContext.getInitParameter(INIT_PARAM_ADD_RESOURCE_CLASS);
1104 
1105         return addResourceClass == null ? INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT : addResourceClass;
1106     }
1107 
1108     /**
1109      * Should the environment be checked so that the ExtensionsFilter will work properly. 
1110      */
1111     public boolean isCheckExtensionsFilter()
1112     {
1113         return _checkExtensionsFilter;
1114     }
1115 
1116     public void setCheckExtensionsFilter(boolean extensionsFilter)
1117     {
1118         _checkExtensionsFilter = extensionsFilter;
1119     }
1120 
1121     public void setRenderClearJavascriptOnButton(
1122             boolean renderClearJavascriptOnButton)
1123     {
1124         _renderClearJavascriptOnButton = renderClearJavascriptOnButton;
1125     }
1126 
1127     /**
1128      * This param renders the clear javascript on button necessary only for
1129      * compatibility with hidden fields feature of myfaces. This is done 
1130      * because jsf ri does not render javascript on onclick method for button,
1131      * so myfaces should do this.
1132      * 
1133      * @return
1134      */
1135     public boolean isRenderClearJavascriptOnButton()
1136     {
1137         return _renderClearJavascriptOnButton;
1138     }
1139 
1140     public boolean isRenderHiddenFieldsForLinkParams()
1141     {
1142         return renderHiddenFieldsForLinkParams;
1143     }
1144 
1145     public void setRenderHiddenFieldsForLinkParams(
1146             boolean renderHiddenFieldsForLinkParams)
1147     {
1148         this.renderHiddenFieldsForLinkParams = renderHiddenFieldsForLinkParams;
1149     }
1150 
1151     public void setSaveFormSubmitLinkIE(boolean saveFormSubmitLinkIE)
1152     {
1153         _saveFormSubmitLinkIE = saveFormSubmitLinkIE;
1154     }
1155 
1156     /**
1157      * Add a code that save the form when submit a form using a
1158      * link. It's a bug on IE.
1159      * 
1160      * @return
1161      */
1162     public boolean isSaveFormSubmitLinkIE()
1163     {
1164         return _saveFormSubmitLinkIE;
1165     }
1166     
1167     public String getDelegateFacesServlet()
1168     {
1169         return _delegateFacesServlet;
1170     }
1171     
1172     public void setDelegateFacesServlet(String delegateFacesServlet)
1173     {
1174         _delegateFacesServlet = delegateFacesServlet;
1175     }
1176 
1177     public boolean isRefreshTransientBuildOnPSS()
1178     {
1179         return _refreshTransientBuildOnPSS;
1180     }
1181 
1182     public void setRefreshTransientBuildOnPSS(boolean refreshTransientBuildOnPSS)
1183     {
1184         this._refreshTransientBuildOnPSS = refreshTransientBuildOnPSS;
1185     }
1186 
1187     public boolean isRefreshTransientBuildOnPSSAuto()
1188     {
1189         return _refreshTransientBuildOnPSSAuto;
1190     }
1191 
1192     public void setRefreshTransientBuildOnPSSAuto(
1193             boolean refreshTransientBuildOnPSSAuto)
1194     {
1195         this._refreshTransientBuildOnPSSAuto = refreshTransientBuildOnPSSAuto;
1196     }
1197 
1198     public boolean isRefreshTransientBuildOnPSSPreserveState()
1199     {
1200         return refreshTransientBuildOnPSSPreserveState;
1201     }
1202 
1203     public void setRefreshTransientBuildOnPSSPreserveState(
1204             boolean refreshTransientBuildOnPSSPreserveState)
1205     {
1206         this.refreshTransientBuildOnPSSPreserveState = refreshTransientBuildOnPSSPreserveState;
1207     }
1208     
1209     public boolean isValidateXML()
1210     {
1211         return _validateXML;
1212     }
1213 
1214     public void setValidateXML(boolean validateXML)
1215     {
1216         _validateXML = validateXML;
1217     }
1218 
1219     public boolean isWrapScriptContentWithXmlCommentTag()
1220     {
1221         return _wrapScriptContentWithXmlCommentTag;
1222     }
1223 
1224     public void setWrapScriptContentWithXmlCommentTag(
1225             boolean wrapScriptContentWithXmlCommentTag)
1226     {
1227         this._wrapScriptContentWithXmlCommentTag = wrapScriptContentWithXmlCommentTag;
1228     }
1229 
1230     public boolean isDebugPhaseListenerEnabled()
1231     {
1232         return _debugPhaseListenerEnabled;
1233     }
1234 
1235     public void setDebugPhaseListenerEnabled(boolean debugPhaseListener)
1236     {
1237         this._debugPhaseListenerEnabled = debugPhaseListener;
1238     }
1239 
1240     public boolean isStrictJsf2CCELResolver()
1241     {
1242         return _strictJsf2CCELResolver;
1243     }
1244 
1245     public void setStrictJsf2CCELResolver(boolean strictJsf2CCELResolver)
1246     {
1247         this._strictJsf2CCELResolver = strictJsf2CCELResolver;
1248     }
1249 
1250     public String getDefaultResponseWriterContentTypeMode()
1251     {
1252         return _defaultResponseWriterContentTypeMode;
1253     }
1254 
1255     public void setDefaultResponseWriterContentTypeMode(
1256             String defaultResponseWriterContentTypeMode)
1257     {
1258         this._defaultResponseWriterContentTypeMode = defaultResponseWriterContentTypeMode;
1259     }
1260 
1261     public boolean isViewUniqueIdsCacheEnabled()
1262     {
1263         return _viewUniqueIdsCacheEnabled;
1264     }
1265 
1266     public void setViewUniqueIdsCacheEnabled(boolean viewUniqueIdsCacheEnabled)
1267     {
1268         _viewUniqueIdsCacheEnabled = viewUniqueIdsCacheEnabled;
1269     }
1270 
1271     public boolean isSupportJSPAndFacesEL()
1272     {
1273         return _supportJSPAndFacesEL;
1274     }
1275 
1276     public void setSupportJSPAndFacesEL(boolean supportJSPANDFacesEL)
1277     {
1278         _supportJSPAndFacesEL = supportJSPANDFacesEL;
1279     }
1280 
1281     public boolean isSupportManagedBeans()
1282     {
1283         return _supportManagedBeans;
1284     }
1285 
1286     public void setSupportManagedBeans(boolean supportManagedBeans)
1287     {
1288         _supportManagedBeans = supportManagedBeans;
1289     }
1290     
1291     public int getComponentUniqueIdsCacheSize()
1292     {
1293         return _componentUniqueIdsCacheSize;
1294     }
1295 
1296     public void setComponentUniqueIdsCacheSize(int componentUniqueIdsCacheSize)
1297     {
1298         this._componentUniqueIdsCacheSize = componentUniqueIdsCacheSize;
1299     }
1300 
1301     public String getGaeJsfJarFiles()
1302     {
1303         return _gaeJsfJarFiles;
1304     }
1305 
1306     public void setGaeJsfJarFiles(String gaeJsfJarFiles)
1307     {
1308         this._gaeJsfJarFiles = gaeJsfJarFiles;
1309     }
1310 
1311     public String getGaeJsfAnnotationsJarFiles()
1312     {
1313         return _gaeJsfAnnotationsJarFiles;
1314     }
1315 
1316     public void setGaeJsfAnnotationsJarFiles(String gaeJsfAnnotationsJarFiles)
1317     {
1318         this._gaeJsfAnnotationsJarFiles = gaeJsfAnnotationsJarFiles;
1319     }
1320 
1321     public boolean isStrictJsf2ViewNotFound()
1322     {
1323         return _strictJsf2ViewNotFound;
1324     }
1325 
1326     public void setStrictJsf2ViewNotFound(boolean strictJsf2ViewNotFound)
1327     {
1328         this._strictJsf2ViewNotFound = strictJsf2ViewNotFound;
1329     }
1330 
1331     public boolean isEarlyFlushEnabled()
1332     {
1333         return _earlyFlushEnabled;
1334     }
1335 
1336     public void setEarlyFlushEnabled(boolean earlyFlushEnabled)
1337     {
1338         this._earlyFlushEnabled = earlyFlushEnabled;
1339     }
1340 
1341     public boolean isStrictJsf2FaceletsCompatibility()
1342     {
1343         return _strictJsf2FaceletsCompatibility;
1344     }
1345 
1346     public void setStrictJsf2FaceletsCompatibility(boolean strictJsf2FaceletsCompatibility)
1347     {
1348         this._strictJsf2FaceletsCompatibility = strictJsf2FaceletsCompatibility;
1349     }
1350 
1351     public boolean isRenderFormViewStateAtBegin()
1352     {
1353         return _renderFormViewStateAtBegin;
1354     }
1355 
1356     public void setRenderFormViewStateAtBegin(boolean renderFormViewStateAtBegin)
1357     {
1358         this._renderFormViewStateAtBegin = renderFormViewStateAtBegin;
1359     }
1360 
1361     public boolean isFlashScopeDisabled()
1362     {
1363         return _flashScopeDisabled;
1364     }
1365 
1366     public void setFlashScopeDisabled(boolean flashScopeDisabled)
1367     {
1368         this._flashScopeDisabled = flashScopeDisabled;
1369     }
1370 
1371     /**
1372      * @return the _numberOfViewsInSession
1373      */
1374     public Integer getNumberOfViewsInSession()
1375     {
1376         return _numberOfViewsInSession;
1377     }
1378 
1379     /**
1380      * @param numberOfViewsInSession the _numberOfViewsInSession to set
1381      */
1382     public void setNumberOfViewsInSession(Integer numberOfViewsInSession)
1383     {
1384         this._numberOfViewsInSession = numberOfViewsInSession;
1385     }
1386 
1387     /**
1388      * @return the _numberOfSequentialViewsInSession
1389      */
1390     public Integer getNumberOfSequentialViewsInSession()
1391     {
1392         return _numberOfSequentialViewsInSession;
1393     }
1394 
1395     /**
1396      * @param numberOfSequentialViewsInSession the _numberOfSequentialViewsInSession to set
1397      */
1398     public void setNumberOfSequentialViewsInSession(Integer numberOfSequentialViewsInSession)
1399     {
1400         this._numberOfSequentialViewsInSession = numberOfSequentialViewsInSession;
1401     }
1402 
1403     /**
1404      * @return the _numberOfFlashTokensInSession
1405      */
1406     public Integer getNumberOfFlashTokensInSession()
1407     {
1408         return _numberOfFlashTokensInSession;
1409     }
1410 
1411     /**
1412      * @param numberOfFlashTokensInSession the _numberOfFlashTokensInSession to set
1413      */
1414     public void setNumberOfFlashTokensInSession(Integer numberOfFlashTokensInSession)
1415     {
1416         this._numberOfFlashTokensInSession = numberOfFlashTokensInSession;
1417     }
1418 
1419     /**
1420      * @return the _numberOfFacesFlowClientWindowIdsInSession
1421      */
1422     public Integer getNumberOfFacesFlowClientWindowIdsInSession()
1423     {
1424         return _numberOfFacesFlowClientWindowIdsInSession;
1425     }
1426 
1427     /**
1428      * @param numberOfFacesFlowClientWindowIdsInSession the _numberOfFacesFlowClientWindowIdsInSession to set
1429      */
1430     public void setNumberOfFacesFlowClientWindowIdsInSession(Integer numberOfFacesFlowClientWindowIdsInSession)
1431     {
1432         this._numberOfFacesFlowClientWindowIdsInSession = numberOfFacesFlowClientWindowIdsInSession;
1433     }
1434     
1435     /**
1436      * @return the _supportEL3ImportHandler
1437      */
1438     public boolean isSupportEL3ImportHandler()
1439     {
1440         return _supportEL3ImportHandler;
1441     }
1442     
1443     /**
1444      * @param supportEL3ImportHandler the _supportEL3ImportHandler to set
1445      */
1446     public void setSupportEL3ImportHandler(boolean supportEL3ImportHandler)
1447     {
1448         this._supportEL3ImportHandler = supportEL3ImportHandler;
1449     }
1450 
1451     public boolean isStrictJsf2OriginHeaderAppPath()
1452     {
1453         return _strictJsf2OriginHeaderAppPath;
1454     }
1455     
1456     public void setStrictJsf2OriginHeaderAppPath(boolean strictJsf2OriginHeaderAppPath)
1457     {
1458         this._strictJsf2OriginHeaderAppPath = strictJsf2OriginHeaderAppPath;
1459     }
1460 
1461     public boolean isAlwaysForceSessionCreation()
1462     {
1463         return _alwaysForceSessionCreation;
1464     }
1465     
1466     /**
1467      * @param alwaysForceSessionCreation the _alwaysForceSessionCreation to set
1468      */
1469     public void setAlwaysForceSessionCreation(boolean alwaysForceSessionCreation)
1470     {
1471         this._alwaysForceSessionCreation = alwaysForceSessionCreation;
1472     }
1473 }