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