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     /**
543      * This parameter specifies whether or not the ImportHandler will be supported
544      */
545     @JSFWebConfigParam(since="2.2.9", defaultValue="false", expectedValues="true,false", group="EL")
546     protected static final String SUPPORT_EL_3_IMPORT_HANDLER = "org.apache.myfaces.SUPPORT_EL_3_IMPORT_HANDLER";
547     public final static boolean SUPPORT_EL_3_IMPORT_HANDLER_DEFAULT = false;
548 
549     private boolean _prettyHtml;
550     private boolean _detectJavascript;
551     private boolean _allowJavascript;
552     private boolean _autoScroll;
553     private String _addResourceClass;
554     private String _resourceVirtualPath;
555     private boolean _checkExtensionsFilter;
556     private boolean _readonlyAsDisabledForSelect;
557     private long _configRefreshPeriod;
558     private boolean _viewStateJavascript;
559     private boolean _renderViewStateId;
560     private boolean _strictXhtmlLinks;
561     private boolean _renderClearJavascriptOnButton;
562     private boolean renderHiddenFieldsForLinkParams;
563     private boolean _saveFormSubmitLinkIE;
564     private String _delegateFacesServlet;
565     private boolean _refreshTransientBuildOnPSS;
566     private boolean _refreshTransientBuildOnPSSAuto;
567     private boolean refreshTransientBuildOnPSSPreserveState;
568     private boolean _validateXML;
569     private boolean _wrapScriptContentWithXmlCommentTag;
570     private boolean _renderFormSubmitScriptInline;
571     private boolean _debugPhaseListenerEnabled;
572     private boolean _strictJsf2RefreshTargetAjax;
573     private boolean _strictJsf2CCELResolver;
574     private String _defaultResponseWriterContentTypeMode;
575     private boolean _viewUniqueIdsCacheEnabled;
576     private int _componentUniqueIdsCacheSize;
577     private boolean _supportJSPAndFacesEL;
578     private String _gaeJsfJarFiles;
579     private String _gaeJsfAnnotationsJarFiles;
580     private boolean _strictJsf2ViewNotFound;
581     private boolean _earlyFlushEnabled;
582     private boolean _cdiManagedConvertersEnabled;
583     private boolean _cdiManagedValidatorsEnabled;
584     private boolean _strictJsf2FaceletsCompatibility;
585     private boolean _renderFormViewStateAtBegin;
586     private boolean _flashScopeDisabled;
587     private Integer _numberOfViewsInSession;
588     private Integer _numberOfSequentialViewsInSession;
589     private Integer _numberOfFlashTokensInSession;
590     private Integer _numberOfFacesFlowClientWindowIdsInSession;
591     private boolean _supportEL3ImportHandler;
592 
593     private static final boolean TOMAHAWK_AVAILABLE;
594     private static final boolean MYFACES_IMPL_AVAILABLE;
595     private static final boolean RI_IMPL_AVAILABLE;
596 
597     static
598     {
599         boolean tomahawkAvailable;
600         try
601         {
602             ClassUtils.classForName("org.apache.myfaces.webapp.filter.ExtensionsFilter");
603             tomahawkAvailable = true;
604         }
605         catch (ClassNotFoundException e)
606         {
607             tomahawkAvailable = false;
608         }
609         TOMAHAWK_AVAILABLE = tomahawkAvailable;
610     }
611 
612     static
613     {
614         boolean myfacesImplAvailable;
615         try
616         {
617             ClassUtils.classForName("org.apache.myfaces.application.ApplicationImpl");
618             myfacesImplAvailable = true;
619         }
620         catch (ClassNotFoundException e)
621         {
622             myfacesImplAvailable = false;
623         }
624         MYFACES_IMPL_AVAILABLE = myfacesImplAvailable;
625     }
626 
627     static
628     {
629         boolean riImplAvailable;
630         try
631         {
632             ClassUtils.classForName("com.sun.faces.application.ApplicationImpl");
633             riImplAvailable = true;
634         }
635         catch (ClassNotFoundException e)
636         {
637             riImplAvailable = false;
638         }
639         RI_IMPL_AVAILABLE = riImplAvailable;
640     }
641 
642     public static MyfacesConfig getCurrentInstance(ExternalContext extCtx)
643     {
644         MyfacesConfig myfacesConfig = (MyfacesConfig) extCtx
645                 .getApplicationMap().get(APPLICATION_MAP_PARAM_NAME);
646         if (myfacesConfig == null)
647         {
648 
649             myfacesConfig = createAndInitializeMyFacesConfig(extCtx);
650 
651             extCtx.getApplicationMap().put(APPLICATION_MAP_PARAM_NAME, myfacesConfig);
652 
653         }
654 
655         return myfacesConfig;
656     }
657     
658     public MyfacesConfig()
659     {
660         setPrettyHtml(INIT_PARAM_PRETTY_HTML_DEFAULT);
661         setAllowJavascript(INIT_PARAM_ALLOW_JAVASCRIPT_DEFAULT);
662         setRenderClearJavascriptOnButton(INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON_DEFAULT);
663         setRenderHiddenFieldsForLinkParams(INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS_DEFAULT);
664         setSaveFormSubmitLinkIE(INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE_DEFAULT);
665         setReadonlyAsDisabledForSelect(INIT_READONLY_AS_DISABLED_FOR_SELECT_DEFAULT);
666         setRenderViewStateId(INIT_PARAM_RENDER_VIEWSTATE_ID_DEFAULT);
667         setStrictXhtmlLinks(INIT_PARAM_STRICT_XHTML_LINKS_DEFAULT);
668         setConfigRefreshPeriod(INIT_PARAM_CONFIG_REFRESH_PERIOD_DEFAULT);        
669         setViewStateJavascript(INIT_PARAM_VIEWSTATE_JAVASCRIPT_DEFAULT);        
670         setRefreshTransientBuildOnPSS(true);
671         setRefreshTransientBuildOnPSSAuto(true);
672         setRefreshTransientBuildOnPSSPreserveState(INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE_DEFAULT);
673         setValidateXML(INIT_PARAM_VALIDATE_XML_DEFAULT);
674         setWrapScriptContentWithXmlCommentTag(INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG_DEFAULT);
675         setDetectJavascript(INIT_PARAM_DETECT_JAVASCRIPT_DEFAULT);
676         setAutoScroll(INIT_PARAM_AUTO_SCROLL_DEFAULT);
677         setAddResourceClass(INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT);
678         setResourceVirtualPath(INIT_PARAM_RESOURCE_VIRTUAL_PATH_DEFAULT);
679         //The default is true but we'll let it false because it depends if 
680         //tomahawk is on classpath and no test environment is set
681         setCheckExtensionsFilter(false);
682         setRenderFormSubmitScriptInline(INIT_PARAM_RENDER_FORM_SUBMIT_SCRIPT_INLINE_DEFAULT);
683         setDebugPhaseListenerEnabled(INIT_PARAM_DEBUG_PHASE_LISTENER_DEFAULT);
684         setStrictJsf2RefreshTargetAjax(INIT_PARAM_STRICT_JSF_2_REFRESH_TARGET_AJAX_DEFAULT);
685         setStrictJsf2CCELResolver(INIT_PARAM_STRICT_JSF_2_CC_EL_RESOLVER_DEFAULT);
686         setDefaultResponseWriterContentTypeMode(INIT_PARAM_DEFAULT_RESPONSE_WRITER_CONTENT_TYPE_MODE_DEFAULT);
687         setViewUniqueIdsCacheEnabled(INIT_PARAM_VIEW_UNIQUE_IDS_CACHE_ENABLED_DEFAULT);
688         setComponentUniqueIdsCacheSize(INIT_PARAM_COMPONENT_UNIQUE_IDS_CACHE_SIZE_DEFAULT);
689         setSupportJSPAndFacesEL(INIT_PARAM_SUPPORT_JSP_AND_FACES_EL_DEFAULT);
690         setGaeJsfJarFiles(INIT_PARAM_GAE_JSF_JAR_FILES_DEFAULT);
691         setGaeJsfAnnotationsJarFiles(INIT_PARAM_GAE_JSF_ANNOTATIONS_JAR_FILES_DEFAULT);
692         setStrictJsf2ViewNotFound(INIT_PARAM_STRICT_JSF_2_VIEW_NOT_FOUND_DEFAULT);
693         setEarlyFlushEnabled(INIT_PARAM_EARLY_FLUSH_ENABLED_DEFAULT);
694         setCdiManagedConvertersEnabled(INIT_PARAM_CDI_MANAGED_CONVERTERS_DEFAULT);
695         setCdiManagedValidatorsEnabled(INIT_PARAM_CDI_MANAGED_VALIDATORS_DEFAULT);
696         setStrictJsf2FaceletsCompatibility(INIT_PARAM_STRICT_JSF_2_FACELETS_COMPATIBILITY_DEFAULT);
697         setRenderFormViewStateAtBegin(INIT_PARAM_RENDER_FORM_VIEW_STATE_AT_BEGIN_DEFAULT);
698         setFlashScopeDisabled(INIT_PARAM_FLASH_SCOPE_DISABLED_DEFAULT);
699         setNumberOfViewsInSession(INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION_DEFAULT);
700         setNumberOfSequentialViewsInSession(INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION_DEFAULT);
701         setNumberOfFlashTokensInSession(
702                 (INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION_DEFAULT / 
703                         INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION_DEFAULT)+1);
704         setSupportEL3ImportHandler(SUPPORT_EL_3_IMPORT_HANDLER_DEFAULT);                        
705     }
706 
707     private static MyfacesConfig createAndInitializeMyFacesConfig(ExternalContext extCtx)
708     {
709         
710         MyfacesConfig myfacesConfig = new MyfacesConfig();
711 
712         myfacesConfig.setPrettyHtml(getBooleanInitParameter(extCtx, INIT_PARAM_PRETTY_HTML,
713                                                             INIT_PARAM_PRETTY_HTML_DEFAULT));
714         myfacesConfig.setAllowJavascript(getBooleanInitParameter(extCtx, INIT_PARAM_ALLOW_JAVASCRIPT,
715                                                                  INIT_PARAM_ALLOW_JAVASCRIPT_DEFAULT));
716 
717         myfacesConfig.setRenderClearJavascriptOnButton(getBooleanInitParameter(extCtx, 
718                                                             INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON,
719                                                             INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON_DEFAULT));
720 
721         myfacesConfig.setRenderHiddenFieldsForLinkParams(getBooleanInitParameter(extCtx, 
722                 INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS,
723                 INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS_DEFAULT));
724 
725         myfacesConfig.setSaveFormSubmitLinkIE(getBooleanInitParameter(extCtx, INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE,
726                                                             INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE_DEFAULT));
727         
728         myfacesConfig.setReadonlyAsDisabledForSelect(getBooleanInitParameter(extCtx, 
729                                                                  INIT_READONLY_AS_DISABLED_FOR_SELECT,
730                                                                  INIT_READONLY_AS_DISABLED_FOR_SELECT_DEFAULT));
731         myfacesConfig.setRenderViewStateId(getBooleanInitParameter(extCtx, INIT_PARAM_RENDER_VIEWSTATE_ID,
732                                                                    INIT_PARAM_RENDER_VIEWSTATE_ID_DEFAULT));
733         myfacesConfig.setStrictXhtmlLinks(getBooleanInitParameter(extCtx, INIT_PARAM_STRICT_XHTML_LINKS,
734                                                                   INIT_PARAM_STRICT_XHTML_LINKS_DEFAULT));
735         myfacesConfig.setRenderFormSubmitScriptInline(getBooleanInitParameter(extCtx,
736                                                                   INIT_PARAM_RENDER_FORM_SUBMIT_SCRIPT_INLINE,
737                                                                   INIT_PARAM_RENDER_FORM_SUBMIT_SCRIPT_INLINE_DEFAULT));
738         
739         myfacesConfig.setConfigRefreshPeriod(getLongInitParameter(extCtx, INIT_PARAM_CONFIG_REFRESH_PERIOD,
740                 INIT_PARAM_CONFIG_REFRESH_PERIOD_DEFAULT));
741 
742         myfacesConfig.setViewStateJavascript(getBooleanInitParameter(extCtx, INIT_PARAM_VIEWSTATE_JAVASCRIPT,
743                 INIT_PARAM_VIEWSTATE_JAVASCRIPT_DEFAULT));
744 
745         myfacesConfig.setDelegateFacesServlet(extCtx.getInitParameter(INIT_PARAM_DELEGATE_FACES_SERVLET));
746         
747         String refreshTransientBuildOnPSS = getStringInitParameter(extCtx, 
748                 INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS, 
749                 INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_DEFAULT);
750         
751         if (refreshTransientBuildOnPSS == null)
752         {
753             myfacesConfig.setRefreshTransientBuildOnPSS(false);
754             myfacesConfig.setRefreshTransientBuildOnPSSAuto(false);
755         }
756         else if ("auto".equalsIgnoreCase(refreshTransientBuildOnPSS))
757         {
758             myfacesConfig.setRefreshTransientBuildOnPSS(true);
759             myfacesConfig.setRefreshTransientBuildOnPSSAuto(true);
760         }
761         else if (refreshTransientBuildOnPSS.equalsIgnoreCase("true") || 
762                 refreshTransientBuildOnPSS.equalsIgnoreCase("on") || 
763                 refreshTransientBuildOnPSS.equalsIgnoreCase("yes"))
764         {
765             myfacesConfig.setRefreshTransientBuildOnPSS(true);
766             myfacesConfig.setRefreshTransientBuildOnPSSAuto(false);
767         }
768         else
769         {
770             myfacesConfig.setRefreshTransientBuildOnPSS(false);
771             myfacesConfig.setRefreshTransientBuildOnPSSAuto(false);
772         }
773         
774         myfacesConfig.setRefreshTransientBuildOnPSSPreserveState(getBooleanInitParameter(extCtx,
775                 INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE, 
776                 INIT_PARAM_REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE_DEFAULT));
777         
778         myfacesConfig.setValidateXML(getBooleanInitParameter(extCtx, INIT_PARAM_VALIDATE_XML, 
779                 INIT_PARAM_VALIDATE_XML_DEFAULT));
780         
781         myfacesConfig.setWrapScriptContentWithXmlCommentTag(getBooleanInitParameter(extCtx, 
782                 INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG, 
783                 INIT_PARAM_WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG_DEFAULT));
784         
785         myfacesConfig.setDebugPhaseListenerEnabled(getBooleanInitParameter(extCtx, INIT_PARAM_DEBUG_PHASE_LISTENER,
786                 INIT_PARAM_DEBUG_PHASE_LISTENER_DEFAULT));
787         
788         myfacesConfig.setStrictJsf2RefreshTargetAjax(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
789                 INIT_PARAM_STRICT_JSF_2_REFRESH_TARGET_AJAX, INIT_PARAM_STRICT_JSF_2_REFRESH_TARGET_AJAX_DEFAULT));
790         
791         myfacesConfig.setStrictJsf2CCELResolver(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
792                 INIT_PARAM_STRICT_JSF_2_CC_EL_RESOLVER, INIT_PARAM_STRICT_JSF_2_CC_EL_RESOLVER_DEFAULT));
793         
794         myfacesConfig.setDefaultResponseWriterContentTypeMode(WebConfigParamUtils.getStringInitParameter(
795                 extCtx, INIT_PARAM_DEFAULT_RESPONSE_WRITER_CONTENT_TYPE_MODE,
796                 INIT_PARAM_DEFAULT_RESPONSE_WRITER_CONTENT_TYPE_MODE_DEFAULT));
797 
798         myfacesConfig.setViewUniqueIdsCacheEnabled(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
799                 INIT_PARAM_VIEW_UNIQUE_IDS_CACHE_ENABLED, INIT_PARAM_VIEW_UNIQUE_IDS_CACHE_ENABLED_DEFAULT));
800         myfacesConfig.setComponentUniqueIdsCacheSize(
801                 WebConfigParamUtils.getIntegerInitParameter(extCtx,
802                 INIT_PARAM_COMPONENT_UNIQUE_IDS_CACHE_SIZE, 
803                 INIT_PARAM_COMPONENT_UNIQUE_IDS_CACHE_SIZE_DEFAULT));
804         myfacesConfig.setSupportJSPAndFacesEL(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
805                 INIT_PARAM_SUPPORT_JSP_AND_FACES_EL, INIT_PARAM_SUPPORT_JSP_AND_FACES_EL_DEFAULT));
806         
807         myfacesConfig.setGaeJsfJarFiles(WebConfigParamUtils.getStringInitParameter(extCtx, 
808                 INIT_PARAM_GAE_JSF_JAR_FILES, INIT_PARAM_GAE_JSF_JAR_FILES_DEFAULT));
809         myfacesConfig.setGaeJsfAnnotationsJarFiles(WebConfigParamUtils.getStringInitParameter(extCtx, 
810                 INIT_PARAM_GAE_JSF_ANNOTATIONS_JAR_FILES, INIT_PARAM_GAE_JSF_ANNOTATIONS_JAR_FILES_DEFAULT));
811 
812         myfacesConfig.setStrictJsf2ViewNotFound(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
813                 INIT_PARAM_STRICT_JSF_2_VIEW_NOT_FOUND, INIT_PARAM_STRICT_JSF_2_VIEW_NOT_FOUND_DEFAULT));
814         
815         myfacesConfig.setEarlyFlushEnabled(WebConfigParamUtils.getBooleanInitParameter(extCtx,
816                 INIT_PARAM_EARLY_FLUSH_ENABLED, INIT_PARAM_EARLY_FLUSH_ENABLED_DEFAULT));
817 
818         myfacesConfig.setCdiManagedConvertersEnabled(WebConfigParamUtils.getBooleanInitParameter(extCtx,
819                 INIT_PARAM_CDI_MANAGED_CONVERTERS_ENABLED, INIT_PARAM_CDI_MANAGED_CONVERTERS_DEFAULT));
820         myfacesConfig.setCdiManagedValidatorsEnabled(WebConfigParamUtils.getBooleanInitParameter(extCtx,
821                 INIT_PARAM_CDI_MANAGED_VALIDATORS_ENABLED, INIT_PARAM_CDI_MANAGED_VALIDATORS_DEFAULT));
822 
823         myfacesConfig.setStrictJsf2FaceletsCompatibility(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
824                 INIT_PARAM_STRICT_JSF_2_FACELETS_COMPATIBILITY, 
825                 INIT_PARAM_STRICT_JSF_2_FACELETS_COMPATIBILITY_DEFAULT));
826         
827         myfacesConfig.setRenderFormViewStateAtBegin(WebConfigParamUtils.getBooleanInitParameter(extCtx,
828                 INIT_PARAM_RENDER_FORM_VIEW_STATE_AT_BEGIN,
829                 INIT_PARAM_RENDER_FORM_VIEW_STATE_AT_BEGIN_DEFAULT));
830         
831         myfacesConfig.setFlashScopeDisabled(WebConfigParamUtils.getBooleanInitParameter(extCtx,
832                 INIT_PARAM_FLASH_SCOPE_DISABLED,
833                 INIT_PARAM_FLASH_SCOPE_DISABLED_DEFAULT));
834         
835         try
836         {
837             myfacesConfig.setNumberOfSequentialViewsInSession(WebConfigParamUtils.getIntegerInitParameter(
838                     extCtx, 
839                     INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION,
840                     INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION_DEFAULT));
841             Integer views = myfacesConfig.getNumberOfSequentialViewsInSession();
842             if (views == null || views < 0)
843             {
844                 Logger.getLogger(MyfacesConfig.class.getName()).severe(
845                         "Configured value for " + INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION
846                           + " is not valid, must be an value >= 0, using default value ("
847                           + INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION_DEFAULT);
848                 views = INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION_DEFAULT;
849             }
850         }
851         catch (Throwable e)
852         {
853             Logger.getLogger(MyfacesConfig.class.getName()).log(Level.SEVERE, "Error determining the value for "
854                    + INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION
855                    + ", expected an integer value > 0, using default value ("
856                    + INIT_PARAM_NUMBER_OF_SEQUENTIAL_VIEWS_IN_SESSION_DEFAULT + "): " + e.getMessage(), e);
857         }        
858         try
859         {
860             myfacesConfig.setNumberOfViewsInSession(WebConfigParamUtils.getIntegerInitParameter(
861                         extCtx, 
862                         INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION,
863                         INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION_DEFAULT));
864             Integer views = myfacesConfig.getNumberOfViewsInSession();
865             if (views == null || views <= 0)
866             {
867                 Logger.getLogger(MyfacesConfig.class.getName()).severe(
868                         "Configured value for " + INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION
869                           + " is not valid, must be an value > 0, using default value ("
870                           + INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION_DEFAULT);
871                 views = INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION_DEFAULT;
872             }
873         }
874         catch (Throwable e)
875         {
876             Logger.getLogger(MyfacesConfig.class.getName()).log(Level.SEVERE, "Error determining the value for "
877                    + INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION
878                    + ", expected an integer value > 0, using default value ("
879                    + INIT_PARAM_NUMBER_OF_VIEWS_IN_SESSION_DEFAULT + "): " + e.getMessage(), e);
880         }
881 
882         Integer numberOfFlashTokensInSessionDefault;
883         Integer i = myfacesConfig.getNumberOfSequentialViewsInSession();
884         int j = myfacesConfig.getNumberOfViewsInSession();
885         if (i != null && i.intValue() > 0)
886         {
887             numberOfFlashTokensInSessionDefault = (j / i.intValue()) + 1;
888         }
889         else
890         {
891             numberOfFlashTokensInSessionDefault = j + 1;
892         }
893         myfacesConfig.setNumberOfFlashTokensInSession(WebConfigParamUtils.getIntegerInitParameter(
894                         extCtx, 
895                         INIT_PARAM_NUMBER_OF_FLASH_TOKENS_IN_SESSION, numberOfFlashTokensInSessionDefault));
896         myfacesConfig.setNumberOfFacesFlowClientWindowIdsInSession(WebConfigParamUtils.getIntegerInitParameter(
897                         extCtx, 
898                         INIT_PARAM_NUMBER_OF_FACES_FLOW_CLIENT_WINDOW_IDS_IN_SESSION, 
899                         numberOfFlashTokensInSessionDefault));
900                         
901         myfacesConfig.setSupportEL3ImportHandler(WebConfigParamUtils.getBooleanInitParameter(extCtx, 
902                        SUPPORT_EL_3_IMPORT_HANDLER, 
903                        SUPPORT_EL_3_IMPORT_HANDLER_DEFAULT));                        
904         
905         if (TOMAHAWK_AVAILABLE)
906         {
907             myfacesConfig.setDetectJavascript(getBooleanInitParameter(extCtx, INIT_PARAM_DETECT_JAVASCRIPT,
908                     INIT_PARAM_DETECT_JAVASCRIPT_DEFAULT));
909             myfacesConfig.setAutoScroll(getBooleanInitParameter(extCtx, INIT_PARAM_AUTO_SCROLL,
910                     INIT_PARAM_AUTO_SCROLL_DEFAULT));
911                         
912             myfacesConfig.setAddResourceClass(getStringInitParameter(extCtx, INIT_PARAM_ADD_RESOURCE_CLASS,
913                     INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT));
914             myfacesConfig.setResourceVirtualPath(getStringInitParameter(extCtx, INIT_PARAM_RESOURCE_VIRTUAL_PATH,
915                     INIT_PARAM_RESOURCE_VIRTUAL_PATH_DEFAULT));
916 
917             myfacesConfig.setCheckExtensionsFilter(getBooleanInitParameter(extCtx, INIT_CHECK_EXTENSIONS_FILTER,
918                     INIT_CHECK_EXTENSIONS_FILTER_DEFAULT));
919             /*
920             if(RI_IMPL_AVAILABLE)
921             {
922                 if(log.isLoggable(Level.INFO))
923                 {
924                     log.info("Starting up Tomahawk on the RI-JSF-Implementation.");
925                 }
926             }
927 
928             if(MYFACES_IMPL_AVAILABLE)
929             {
930                 if(log.isLoggable(Level.INFO))
931                 {
932                     log.info("Starting up Tomahawk on the MyFaces-JSF-Implementation");
933                 }
934             }*/
935         }
936         /*
937         else
938         {
939             if (log.isLoggable(Level.INFO))
940             {
941                 log.info("Tomahawk jar not available. Autoscrolling, DetectJavascript, "+
942                 "AddResourceClass and CheckExtensionsFilter are disabled now.");
943             }
944         }*/
945 
946         /*
947         if(RI_IMPL_AVAILABLE && MYFACES_IMPL_AVAILABLE)
948         {
949             log.severe("Both MyFaces and the RI are on your classpath. Please make sure to"+
950             " use only one of the two JSF-implementations.");
951         }*/
952         return myfacesConfig;
953     }
954 
955     private static boolean getBooleanInitParameter(ExternalContext externalContext,
956                                                    String paramName,
957                                                    boolean defaultValue)
958     {
959         String strValue = externalContext.getInitParameter(paramName);
960         if (strValue == null)
961         {
962             //if (log.isLoggable(Level.INFO)) log.info("No context init parameter '" + 
963             // paramName + "' found, using default value " + defaultValue);
964             return defaultValue;
965         }
966         else if (strValue.equalsIgnoreCase("true") || strValue.equalsIgnoreCase("on") || 
967                 strValue.equalsIgnoreCase("yes"))
968         {
969             return true;
970         }
971         else if (strValue.equalsIgnoreCase("false") || strValue.equalsIgnoreCase("off") || 
972                 strValue.equalsIgnoreCase("no"))
973         {
974             return false;
975         }
976         else
977         {
978             //if (log.isLoggable(Level.WARNING)) log.warning("Wrong context init parameter '" + 
979             //paramName + "' (='" + strValue + "'), using default value " + defaultValue);
980             return defaultValue;
981         }
982     }
983 
984     private static String getStringInitParameter(ExternalContext externalContext,
985                                                  String paramName,
986                                                  String defaultValue)
987     {
988         String strValue = externalContext.getInitParameter(paramName);
989         if (strValue == null)
990         {
991             //if (log.isLoggable(Level.INFO)) log.info("No context init parameter '" + paramName +
992             //"' found, using default value " + defaultValue); //defaultValue==null should not be 
993             //a problem here
994             return defaultValue;
995         }
996         
997         return strValue;
998     }
999 
1000     private static long getLongInitParameter(ExternalContext externalContext,
1001                                                   String paramName,
1002                                                   long defaultValue)
1003     {
1004        String strValue = externalContext.getInitParameter(paramName);
1005        if (strValue == null)
1006        {
1007            //if (log.isLoggable(Level.INFO)) log.info("No context init parameter '" +paramName +
1008            //"' found, using default value " +defaultValue);
1009            return defaultValue;
1010        }
1011        else
1012        {
1013            try
1014            {
1015                return Long.parseLong(strValue);
1016            }
1017            catch (NumberFormatException e)
1018            {
1019                //if (log.isLoggable(Level.WARNING)) log.warning("Wrong context init parameter '" +
1020                //paramName + "' (='" + strValue + "'), using default value " + defaultValue);
1021            }
1022            return defaultValue;
1023        }
1024     }
1025         
1026      private void setResourceVirtualPath( String resourceVirtualPath )
1027      {
1028          this._resourceVirtualPath = resourceVirtualPath;
1029     }
1030 
1031      public String getResourceVirtualPath()
1032      {
1033          return this._resourceVirtualPath;
1034      }
1035 
1036     public boolean isPrettyHtml()
1037     {
1038         return _prettyHtml;
1039     }
1040 
1041     private void setPrettyHtml(boolean prettyHtml)
1042     {
1043         _prettyHtml = prettyHtml;
1044     }
1045 
1046     public boolean isDetectJavascript()
1047     {
1048         return _detectJavascript;
1049     }
1050 
1051     private void setDetectJavascript(boolean detectJavascript)
1052     {
1053         _detectJavascript = detectJavascript;
1054     }
1055 
1056     private void setReadonlyAsDisabledForSelect(boolean readonlyAsDisabledForSelect)
1057     {
1058         _readonlyAsDisabledForSelect = readonlyAsDisabledForSelect;
1059     }
1060 
1061     public boolean isReadonlyAsDisabledForSelect()
1062     {
1063         return _readonlyAsDisabledForSelect;
1064     }
1065 
1066 
1067    public long getConfigRefreshPeriod()
1068    {
1069        return _configRefreshPeriod;
1070    }
1071 
1072    public void setConfigRefreshPeriod(long configRefreshPeriod)
1073    {
1074        _configRefreshPeriod = configRefreshPeriod;
1075    }
1076 
1077     /**
1078      * JSF API 1.2 defines a "javax.faces.ViewState" client parameter, that must be rendered as both the "name"
1079      * and the "id" attribute of the hidden input that is rendered for the purpose of state saving
1080      * (see ResponseStateManager.VIEW_STATE_PARAM).
1081      * Actually this causes duplicate id attributes and thus invalid XHTML pages when multiple forms are rendered on
1082      * one page. With the {@link #INIT_PARAM_RENDER_VIEWSTATE_ID} context parameter you can tune this behaviour.
1083      * <br/>Set it to
1084      * <ul><li>true - to render JSF 1.2 compliant id attributes (that might cause invalid XHTML), or</li>
1085      * <li>false - to omit rendering of the id attribute (which is only needed for very special AJAX/Javascript 
1086      * components)</li></ul>
1087      * Default value is: true (for backwards compatibility and JSF 1.2 compliancy) 
1088      * @return true, if the client state hidden input "javax.faces.ViewState" id attribute should be rendered
1089      */
1090     public boolean isRenderViewStateId()
1091     {
1092         return _renderViewStateId;
1093     }
1094 
1095     public void setRenderViewStateId(boolean renderViewStateId)
1096     {
1097         _renderViewStateId = renderViewStateId;
1098     }
1099 
1100     /**
1101      * <p>W3C recommends to use the "&amp;amp;" entity instead of a plain "&amp;" character within HTML.
1102      * This also applies to attribute values and thus to the "href" attribute of &lt;a&gt; elements as well.
1103      * Even more, when XHTML is used as output the usage of plain "&amp;" characters is forbidden and would lead to
1104      * invalid XML code.
1105      * Therefore, since version 1.1.6 MyFaces renders the correct "&amp;amp;" entity for links.</p>
1106      * <p>The init parameter
1107      * {@link #INIT_PARAM_STRICT_XHTML_LINKS} makes it possible to restore the old behaviour and to make MyFaces
1108      * "bug compatible" to the Sun RI which renders plain "&amp;" chars in links as well.</p>
1109      * @see <a href="http://www.w3.org/TR/html401/charset.html#h-5.3.2">HTML 4.01 Specification</a>
1110      * @see <a href="http://issues.apache.org/jira/browse/MYFACES-1774">Jira: MYFACES-1774</a>
1111      * @return true if ampersand characters ("&amp;") should be correctly rendered as "&amp;amp;" entities 
1112      *         within link urls (=default), false for old (XHTML incompatible) behaviour
1113      */
1114     public boolean isStrictXhtmlLinks()
1115     {
1116         return _strictXhtmlLinks;
1117     }
1118 
1119     public void setStrictXhtmlLinks(boolean strictXhtmlLinks)
1120     {
1121         _strictXhtmlLinks = strictXhtmlLinks;
1122     }
1123 
1124     public boolean isTomahawkAvailable()
1125     {
1126         return TOMAHAWK_AVAILABLE;
1127     }
1128 
1129     public boolean isMyfacesImplAvailable()
1130     {
1131         return MYFACES_IMPL_AVAILABLE;
1132     }
1133 
1134     public boolean isRiImplAvailable()
1135     {
1136         return RI_IMPL_AVAILABLE;
1137     }
1138 
1139     /**
1140      * Do not use this in renderers directly!
1141      * You should use {@link org.apache.myfaces.shared.renderkit.html.util.JavascriptUtils#isJavascriptAllowed}
1142      * to determine if javascript is allowed or not.
1143      */
1144     public boolean isAllowJavascript()
1145     {
1146         return _allowJavascript;
1147     }
1148 
1149     private void setAllowJavascript(boolean allowJavascript)
1150     {
1151         _allowJavascript = allowJavascript;
1152     }
1153 
1154     public boolean isAutoScroll()
1155     {
1156         return _autoScroll;
1157     }
1158 
1159     private void setAutoScroll(boolean autoScroll)
1160     {
1161         _autoScroll = autoScroll;
1162     }
1163 
1164     private void setAddResourceClass(String addResourceClass)
1165     {
1166         _addResourceClass = addResourceClass;
1167     }
1168 
1169     public String getAddResourceClass()
1170     {
1171         return _addResourceClass;
1172     }
1173 
1174     /**
1175      * ExtensionFilter needs access to AddResourceClass init param without having
1176      * an ExternalContext at hand.
1177      */
1178     public static String getAddResourceClassFromServletContext(ServletContext servletContext)
1179     {
1180         String addResourceClass = servletContext.getInitParameter(INIT_PARAM_ADD_RESOURCE_CLASS);
1181 
1182         return addResourceClass == null ? INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT : addResourceClass;
1183     }
1184 
1185     /**
1186      * Should the environment be checked so that the ExtensionsFilter will work properly. 
1187      */
1188     public boolean isCheckExtensionsFilter()
1189     {
1190         return _checkExtensionsFilter;
1191     }
1192 
1193     public void setCheckExtensionsFilter(boolean extensionsFilter)
1194     {
1195         _checkExtensionsFilter = extensionsFilter;
1196     }
1197 
1198     /**
1199      * 
1200      */
1201     public boolean isViewStateJavascript()
1202     {
1203         return _viewStateJavascript;
1204     }
1205 
1206     private void setViewStateJavascript(boolean viewStateJavascript)
1207     {
1208         _viewStateJavascript = viewStateJavascript;
1209     }
1210 
1211     public void setRenderClearJavascriptOnButton(
1212             boolean renderClearJavascriptOnButton)
1213     {
1214         _renderClearJavascriptOnButton = renderClearJavascriptOnButton;
1215     }
1216 
1217     /**
1218      * This param renders the clear javascript on button necessary only for
1219      * compatibility with hidden fields feature of myfaces. This is done 
1220      * because jsf ri does not render javascript on onclick method for button,
1221      * so myfaces should do this.
1222      * 
1223      * @return
1224      */
1225     public boolean isRenderClearJavascriptOnButton()
1226     {
1227         return _renderClearJavascriptOnButton;
1228     }
1229 
1230     public boolean isRenderHiddenFieldsForLinkParams()
1231     {
1232         return renderHiddenFieldsForLinkParams;
1233     }
1234 
1235     public void setRenderHiddenFieldsForLinkParams(
1236             boolean renderHiddenFieldsForLinkParams)
1237     {
1238         this.renderHiddenFieldsForLinkParams = renderHiddenFieldsForLinkParams;
1239     }
1240 
1241     public void setSaveFormSubmitLinkIE(boolean saveFormSubmitLinkIE)
1242     {
1243         _saveFormSubmitLinkIE = saveFormSubmitLinkIE;
1244     }
1245 
1246     /**
1247      * Add a code that save the form when submit a form using a
1248      * link. It's a bug on IE.
1249      * 
1250      * @return
1251      */
1252     public boolean isSaveFormSubmitLinkIE()
1253     {
1254         return _saveFormSubmitLinkIE;
1255     }
1256     
1257     public String getDelegateFacesServlet()
1258     {
1259         return _delegateFacesServlet;
1260     }
1261     
1262     public void setDelegateFacesServlet(String delegateFacesServlet)
1263     {
1264         _delegateFacesServlet = delegateFacesServlet;
1265     }
1266 
1267     public boolean isRefreshTransientBuildOnPSS()
1268     {
1269         return _refreshTransientBuildOnPSS;
1270     }
1271 
1272     public void setRefreshTransientBuildOnPSS(boolean refreshTransientBuildOnPSS)
1273     {
1274         this._refreshTransientBuildOnPSS = refreshTransientBuildOnPSS;
1275     }
1276 
1277     public boolean isRefreshTransientBuildOnPSSAuto()
1278     {
1279         return _refreshTransientBuildOnPSSAuto;
1280     }
1281 
1282     public void setRefreshTransientBuildOnPSSAuto(
1283             boolean refreshTransientBuildOnPSSAuto)
1284     {
1285         this._refreshTransientBuildOnPSSAuto = refreshTransientBuildOnPSSAuto;
1286     }
1287 
1288     public boolean isRefreshTransientBuildOnPSSPreserveState()
1289     {
1290         return refreshTransientBuildOnPSSPreserveState;
1291     }
1292 
1293     public void setRefreshTransientBuildOnPSSPreserveState(
1294             boolean refreshTransientBuildOnPSSPreserveState)
1295     {
1296         this.refreshTransientBuildOnPSSPreserveState = refreshTransientBuildOnPSSPreserveState;
1297     }
1298     
1299     public boolean isValidateXML()
1300     {
1301         return _validateXML;
1302     }
1303 
1304     public void setValidateXML(boolean validateXML)
1305     {
1306         _validateXML = validateXML;
1307     }
1308 
1309     public boolean isWrapScriptContentWithXmlCommentTag()
1310     {
1311         return _wrapScriptContentWithXmlCommentTag;
1312     }
1313 
1314     public void setWrapScriptContentWithXmlCommentTag(
1315             boolean wrapScriptContentWithXmlCommentTag)
1316     {
1317         this._wrapScriptContentWithXmlCommentTag = wrapScriptContentWithXmlCommentTag;
1318     }
1319 
1320     public boolean isRenderFormSubmitScriptInline()
1321     {
1322         return _renderFormSubmitScriptInline;
1323     }
1324 
1325     public void setRenderFormSubmitScriptInline(
1326             boolean renderFormSubmitScriptInline)
1327     {
1328         _renderFormSubmitScriptInline = renderFormSubmitScriptInline;
1329     }
1330 
1331     public boolean isDebugPhaseListenerEnabled()
1332     {
1333         return _debugPhaseListenerEnabled;
1334     }
1335 
1336     public void setDebugPhaseListenerEnabled(boolean debugPhaseListener)
1337     {
1338         this._debugPhaseListenerEnabled = debugPhaseListener;
1339     }
1340 
1341     public boolean isStrictJsf2RefreshTargetAjax()
1342     {
1343         return _strictJsf2RefreshTargetAjax;
1344     }
1345 
1346     public void setStrictJsf2RefreshTargetAjax(boolean strictJsf2RefreshTargetAjax)
1347     {
1348         this._strictJsf2RefreshTargetAjax = strictJsf2RefreshTargetAjax;
1349     }
1350 
1351     public boolean isStrictJsf2CCELResolver()
1352     {
1353         return _strictJsf2CCELResolver;
1354     }
1355 
1356     public void setStrictJsf2CCELResolver(boolean strictJsf2CCELResolver)
1357     {
1358         this._strictJsf2CCELResolver = strictJsf2CCELResolver;
1359     }
1360 
1361     public String getDefaultResponseWriterContentTypeMode()
1362     {
1363         return _defaultResponseWriterContentTypeMode;
1364     }
1365 
1366     public void setDefaultResponseWriterContentTypeMode(
1367             String defaultResponseWriterContentTypeMode)
1368     {
1369         this._defaultResponseWriterContentTypeMode = defaultResponseWriterContentTypeMode;
1370     }
1371 
1372     public boolean isViewUniqueIdsCacheEnabled()
1373     {
1374         return _viewUniqueIdsCacheEnabled;
1375     }
1376 
1377     public void setViewUniqueIdsCacheEnabled(boolean viewUniqueIdsCacheEnabled)
1378     {
1379         _viewUniqueIdsCacheEnabled = viewUniqueIdsCacheEnabled;
1380     }
1381 
1382     public boolean isSupportJSPAndFacesEL()
1383     {
1384         return _supportJSPAndFacesEL;
1385     }
1386 
1387     public void setSupportJSPAndFacesEL(
1388             boolean supportJSPANDFacesEL)
1389     {
1390         _supportJSPAndFacesEL = supportJSPANDFacesEL;
1391     }
1392 
1393     public int getComponentUniqueIdsCacheSize()
1394     {
1395         return _componentUniqueIdsCacheSize;
1396     }
1397 
1398     public void setComponentUniqueIdsCacheSize(int componentUniqueIdsCacheSize)
1399     {
1400         this._componentUniqueIdsCacheSize = componentUniqueIdsCacheSize;
1401     }
1402 
1403     public String getGaeJsfJarFiles()
1404     {
1405         return _gaeJsfJarFiles;
1406     }
1407 
1408     public void setGaeJsfJarFiles(String gaeJsfJarFiles)
1409     {
1410         this._gaeJsfJarFiles = gaeJsfJarFiles;
1411     }
1412 
1413     public String getGaeJsfAnnotationsJarFiles()
1414     {
1415         return _gaeJsfAnnotationsJarFiles;
1416     }
1417 
1418     public void setGaeJsfAnnotationsJarFiles(String gaeJsfAnnotationsJarFiles)
1419     {
1420         this._gaeJsfAnnotationsJarFiles = gaeJsfAnnotationsJarFiles;
1421     }
1422 
1423     public boolean isStrictJsf2ViewNotFound()
1424     {
1425         return _strictJsf2ViewNotFound;
1426     }
1427 
1428     public void setStrictJsf2ViewNotFound(boolean strictJsf2ViewNotFound)
1429     {
1430         this._strictJsf2ViewNotFound = strictJsf2ViewNotFound;
1431     }
1432 
1433     public boolean isEarlyFlushEnabled()
1434     {
1435         return _earlyFlushEnabled;
1436     }
1437 
1438     public void setEarlyFlushEnabled(boolean earlyFlushEnabled)
1439     {
1440         this._earlyFlushEnabled = earlyFlushEnabled;
1441     }
1442 
1443     public boolean isCdiManagedConvertersEnabled()
1444     {
1445         return _cdiManagedConvertersEnabled;
1446     }
1447 
1448     public void setCdiManagedConvertersEnabled(boolean cdiManagedConvertersEnabled)
1449     {
1450         this._cdiManagedConvertersEnabled = cdiManagedConvertersEnabled;
1451     }
1452 
1453     public boolean isCdiManagedValidatorsEnabled()
1454     {
1455         return _cdiManagedValidatorsEnabled;
1456     }
1457 
1458     public void setCdiManagedValidatorsEnabled(boolean cdiManagedValidatorsEnabled)
1459     {
1460         this._cdiManagedValidatorsEnabled = cdiManagedValidatorsEnabled;
1461     }
1462 
1463     public boolean isStrictJsf2FaceletsCompatibility()
1464     {
1465         return _strictJsf2FaceletsCompatibility;
1466     }
1467 
1468     public void setStrictJsf2FaceletsCompatibility(boolean strictJsf2FaceletsCompatibility)
1469     {
1470         this._strictJsf2FaceletsCompatibility = strictJsf2FaceletsCompatibility;
1471     }
1472 
1473     public boolean isRenderFormViewStateAtBegin()
1474     {
1475         return _renderFormViewStateAtBegin;
1476     }
1477 
1478     public void setRenderFormViewStateAtBegin(boolean renderFormViewStateAtBegin)
1479     {
1480         this._renderFormViewStateAtBegin = renderFormViewStateAtBegin;
1481     }
1482 
1483     public boolean isFlashScopeDisabled()
1484     {
1485         return _flashScopeDisabled;
1486     }
1487 
1488     public void setFlashScopeDisabled(boolean flashScopeDisabled)
1489     {
1490         this._flashScopeDisabled = flashScopeDisabled;
1491     }
1492 
1493     /**
1494      * @return the _numberOfViewsInSession
1495      */
1496     public Integer getNumberOfViewsInSession()
1497     {
1498         return _numberOfViewsInSession;
1499     }
1500 
1501     /**
1502      * @param _numberOfViewsInSession the _numberOfViewsInSession to set
1503      */
1504     public void setNumberOfViewsInSession(Integer numberOfViewsInSession)
1505     {
1506         this._numberOfViewsInSession = numberOfViewsInSession;
1507     }
1508 
1509     /**
1510      * @return the _numberOfSequentialViewsInSession
1511      */
1512     public Integer getNumberOfSequentialViewsInSession()
1513     {
1514         return _numberOfSequentialViewsInSession;
1515     }
1516 
1517     /**
1518      * @param _numberOfSequentialViewsInSession the _numberOfSequentialViewsInSession to set
1519      */
1520     public void setNumberOfSequentialViewsInSession(Integer numberOfSequentialViewsInSession)
1521     {
1522         this._numberOfSequentialViewsInSession = numberOfSequentialViewsInSession;
1523     }
1524 
1525     /**
1526      * @return the _numberOfFlashTokensInSession
1527      */
1528     public Integer getNumberOfFlashTokensInSession()
1529     {
1530         return _numberOfFlashTokensInSession;
1531     }
1532 
1533     /**
1534      * @param _numberOfFlashTokensInSession the _numberOfFlashTokensInSession to set
1535      */
1536     public void setNumberOfFlashTokensInSession(Integer numberOfFlashTokensInSession)
1537     {
1538         this._numberOfFlashTokensInSession = numberOfFlashTokensInSession;
1539     }
1540 
1541     /**
1542      * @return the _numberOfFacesFlowClientWindowIdsInSession
1543      */
1544     public Integer getNumberOfFacesFlowClientWindowIdsInSession()
1545     {
1546         return _numberOfFacesFlowClientWindowIdsInSession;
1547     }
1548 
1549     /**
1550      * @param _numberOfFacesFlowClientWindowIdsInSession the _numberOfFacesFlowClientWindowIdsInSession to set
1551      */
1552     public void setNumberOfFacesFlowClientWindowIdsInSession(Integer numberOfFacesFlowClientWindowIdsInSession)
1553     {
1554         this._numberOfFacesFlowClientWindowIdsInSession = numberOfFacesFlowClientWindowIdsInSession;
1555     }
1556     
1557     /**
1558      * @return the _supportEL3ImportHandler
1559      */
1560     public boolean isSupportEL3ImportHandler()
1561     {
1562         return _supportEL3ImportHandler;
1563     }
1564     
1565     /**
1566      * @param supportEL3ImportHandler the _supportEL3ImportHandler to set
1567      */
1568     public void setSupportEL3ImportHandler(boolean supportEL3ImportHandler)
1569     {
1570         this._supportEL3ImportHandler = supportEL3ImportHandler;
1571     }
1572 }