1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
package org.apache.myfaces.shared_impl.config; |
20 | |
|
21 | |
import org.apache.commons.logging.Log; |
22 | |
import org.apache.commons.logging.LogFactory; |
23 | |
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFWebConfigParam; |
24 | |
import org.apache.myfaces.shared_impl.util.ClassUtils; |
25 | |
|
26 | |
import javax.faces.context.ExternalContext; |
27 | |
import javax.servlet.ServletContext; |
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
|
44 | |
|
45 | 0 | public class MyfacesConfig |
46 | |
{ |
47 | 0 | private static final Log log = LogFactory.getLog(MyfacesConfig.class); |
48 | |
|
49 | 0 | private static final String APPLICATION_MAP_PARAM_NAME = MyfacesConfig.class.getName(); |
50 | |
|
51 | |
public static final String INIT_PARAM_RESOURCE_VIRTUAL_PATH = "org.apache.myfaces.RESOURCE_VIRTUAL_PATH"; |
52 | |
public static final String INIT_PARAM_RESOURCE_VIRTUAL_PATH_DEFAULT = "/faces/myFacesExtensionResource"; |
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
@JSFWebConfigParam(defaultValue="true", expectedValues="true,false",since="1.1") |
60 | |
private static final String INIT_PARAM_PRETTY_HTML = "org.apache.myfaces.PRETTY_HTML"; |
61 | |
private static final boolean INIT_PARAM_PRETTY_HTML_DEFAULT = true; |
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | |
@JSFWebConfigParam(defaultValue="true", expectedValues="true,false",since="1.1") |
72 | |
private static final String INIT_PARAM_ALLOW_JAVASCRIPT = "org.apache.myfaces.ALLOW_JAVASCRIPT"; |
73 | |
private static final boolean INIT_PARAM_ALLOW_JAVASCRIPT_DEFAULT = true; |
74 | |
|
75 | |
|
76 | |
|
77 | |
|
78 | |
@JSFWebConfigParam(defaultValue="false", expectedValues="true,false",since="1.1") |
79 | |
private static final String INIT_PARAM_DETECT_JAVASCRIPT = "org.apache.myfaces.DETECT_JAVASCRIPT"; |
80 | |
private static final boolean INIT_PARAM_DETECT_JAVASCRIPT_DEFAULT = false; |
81 | |
|
82 | |
|
83 | |
|
84 | |
|
85 | |
|
86 | |
|
87 | |
|
88 | |
|
89 | |
@JSFWebConfigParam(defaultValue="false", expectedValues="true,false",since="1.1") |
90 | |
private static final String INIT_PARAM_AUTO_SCROLL = "org.apache.myfaces.AUTO_SCROLL"; |
91 | |
private static final boolean INIT_PARAM_AUTO_SCROLL_DEFAULT = false; |
92 | |
|
93 | |
|
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | |
|
100 | |
|
101 | |
|
102 | |
|
103 | |
@JSFWebConfigParam(defaultValue="org.apache.myfaces.renderkit.html.util.DefaultAddResource",since="1.1") |
104 | |
private static final String INIT_PARAM_ADD_RESOURCE_CLASS = "org.apache.myfaces.ADD_RESOURCE_CLASS"; |
105 | |
private static final String INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT = "org.apache.myfaces.renderkit.html.util.DefaultAddResource"; |
106 | |
|
107 | |
|
108 | |
|
109 | |
|
110 | |
|
111 | |
|
112 | |
|
113 | |
|
114 | |
|
115 | |
|
116 | |
|
117 | |
@JSFWebConfigParam(defaultValue="true", expectedValues="true,false",since="1.1") |
118 | |
private static final String INIT_CHECK_EXTENSIONS_FILTER = "org.apache.myfaces.CHECK_EXTENSIONS_FILTER"; |
119 | |
private static final boolean INIT_CHECK_EXTENSIONS_FILTER_DEFAULT = true; |
120 | |
|
121 | |
|
122 | |
|
123 | |
|
124 | |
@JSFWebConfigParam(defaultValue="true", expectedValues="true,false",since="1.1") |
125 | |
private static final String INIT_READONLY_AS_DISABLED_FOR_SELECT = "org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS"; |
126 | |
private static final boolean INIT_READONLY_AS_DISABLED_FOR_SELECT_DEFAULT = true; |
127 | |
|
128 | |
|
129 | |
|
130 | |
|
131 | |
@JSFWebConfigParam(defaultValue="2",since="1.1") |
132 | |
public static final String INIT_PARAM_CONFIG_REFRESH_PERIOD = "org.apache.myfaces.CONFIG_REFRESH_PERIOD"; |
133 | |
public static final long INIT_PARAM_CONFIG_REFRESH_PERIOD_DEFAULT = 2; |
134 | |
|
135 | |
|
136 | |
|
137 | |
|
138 | |
@JSFWebConfigParam(defaultValue="false", expectedValues="true,false",since="1.1") |
139 | |
private static final String INIT_PARAM_VIEWSTATE_JAVASCRIPT = "org.apache.myfaces.VIEWSTATE_JAVASCRIPT"; |
140 | |
private static final boolean INIT_PARAM_VIEWSTATE_JAVASCRIPT_DEFAULT = false; |
141 | |
|
142 | |
|
143 | |
|
144 | |
|
145 | |
@JSFWebConfigParam(defaultValue="true", expectedValues="true,false",since="1.1") |
146 | |
private static final String INIT_PARAM_RENDER_VIEWSTATE_ID = "org.apache.myfaces.RENDER_VIEWSTATE_ID"; |
147 | |
private static final boolean INIT_PARAM_RENDER_VIEWSTATE_ID_DEFAULT = true; |
148 | |
|
149 | |
|
150 | |
|
151 | |
|
152 | |
@JSFWebConfigParam(defaultValue="true", expectedValues="true,false",since="1.1") |
153 | |
private static final String INIT_PARAM_STRICT_XHTML_LINKS = "org.apache.myfaces.STRICT_XHTML_LINKS"; |
154 | |
private static final boolean INIT_PARAM_STRICT_XHTML_LINKS_DEFAULT = true; |
155 | |
|
156 | |
|
157 | |
|
158 | |
|
159 | |
|
160 | |
|
161 | |
|
162 | |
@JSFWebConfigParam(defaultValue="false", expectedValues="true,false",since="1.2.3") |
163 | |
private static final String INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON = "org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON"; |
164 | |
private static final boolean INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON_DEFAULT= false; |
165 | |
|
166 | |
|
167 | |
|
168 | |
|
169 | |
|
170 | |
|
171 | |
|
172 | |
@JSFWebConfigParam(defaultValue="false", expectedValues="true,false",since="1.2.9") |
173 | |
private static final String INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS = "org.apache.myfaces.RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS"; |
174 | |
private static final boolean INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS_DEFAULT= false; |
175 | |
|
176 | |
|
177 | |
|
178 | |
|
179 | |
|
180 | |
@JSFWebConfigParam(defaultValue="false", expectedValues="true,false",since="1.1") |
181 | |
private static final String INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE = "org.apache.myfaces.SAVE_FORM_SUBMIT_LINK_IE"; |
182 | |
private static final boolean INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE_DEFAULT = false; |
183 | |
|
184 | |
|
185 | |
|
186 | |
|
187 | |
@JSFWebConfigParam(since="1.2.7") |
188 | |
private static final String INIT_PARAM_DELEGATE_FACES_SERVLET = "org.apache.myfaces.DELEGATE_FACES_SERVLET"; |
189 | |
|
190 | |
private boolean _prettyHtml; |
191 | |
private boolean _detectJavascript; |
192 | |
private boolean _allowJavascript; |
193 | |
private boolean _autoScroll; |
194 | |
private String _addResourceClass; |
195 | |
private String _resourceVirtualPath; |
196 | |
private boolean _checkExtensionsFilter; |
197 | |
private boolean _readonlyAsDisabledForSelect; |
198 | |
private long _configRefreshPeriod; |
199 | |
private boolean _viewStateJavascript; |
200 | |
private boolean _renderViewStateId; |
201 | |
private boolean _strictXhtmlLinks; |
202 | |
private boolean _renderClearJavascriptOnButton; |
203 | |
private boolean renderHiddenFieldsForLinkParams; |
204 | |
private boolean _saveFormSubmitLinkIE; |
205 | |
private String _delegateFacesServlet; |
206 | |
|
207 | |
|
208 | |
private static final boolean TOMAHAWK_AVAILABLE; |
209 | |
private static final boolean MYFACES_IMPL_AVAILABLE; |
210 | |
private static final boolean RI_IMPL_AVAILABLE; |
211 | |
|
212 | |
static |
213 | |
{ |
214 | |
boolean tomahawkAvailable; |
215 | |
try |
216 | |
{ |
217 | 0 | ClassUtils.classForName("org.apache.myfaces.webapp.filter.ExtensionsFilter"); |
218 | 0 | tomahawkAvailable = true; |
219 | |
} |
220 | 0 | catch (ClassNotFoundException e) |
221 | |
{ |
222 | 0 | tomahawkAvailable = false; |
223 | 0 | } |
224 | 0 | TOMAHAWK_AVAILABLE = tomahawkAvailable; |
225 | |
} |
226 | |
|
227 | |
static |
228 | |
{ |
229 | |
boolean myfacesImplAvailable; |
230 | |
try |
231 | |
{ |
232 | 0 | ClassUtils.classForName("org.apache.myfaces.application.ApplicationImpl"); |
233 | 0 | myfacesImplAvailable = true; |
234 | |
} |
235 | 0 | catch (ClassNotFoundException e) |
236 | |
{ |
237 | 0 | myfacesImplAvailable = false; |
238 | 0 | } |
239 | 0 | MYFACES_IMPL_AVAILABLE = myfacesImplAvailable; |
240 | |
} |
241 | |
|
242 | |
static |
243 | |
{ |
244 | |
boolean riImplAvailable; |
245 | |
try |
246 | |
{ |
247 | 0 | ClassUtils.classForName("com.sun.faces.application.ApplicationImpl"); |
248 | 0 | riImplAvailable = true; |
249 | |
} |
250 | 0 | catch (ClassNotFoundException e) |
251 | |
{ |
252 | 0 | riImplAvailable = false; |
253 | 0 | } |
254 | 0 | RI_IMPL_AVAILABLE = riImplAvailable; |
255 | 0 | } |
256 | |
|
257 | |
public static MyfacesConfig getCurrentInstance(ExternalContext extCtx) |
258 | |
{ |
259 | 0 | MyfacesConfig myfacesConfig = (MyfacesConfig) extCtx |
260 | |
.getApplicationMap().get(APPLICATION_MAP_PARAM_NAME); |
261 | 0 | if (myfacesConfig == null) |
262 | |
{ |
263 | |
|
264 | 0 | myfacesConfig = createAndInitializeMyFacesConfig(extCtx); |
265 | |
|
266 | 0 | extCtx.getApplicationMap().put(APPLICATION_MAP_PARAM_NAME, myfacesConfig); |
267 | |
|
268 | |
} |
269 | |
|
270 | 0 | return myfacesConfig; |
271 | |
} |
272 | |
|
273 | |
private static MyfacesConfig createAndInitializeMyFacesConfig(ExternalContext extCtx) { |
274 | |
|
275 | 0 | MyfacesConfig myfacesConfig = new MyfacesConfig(); |
276 | |
|
277 | 0 | myfacesConfig.setPrettyHtml(getBooleanInitParameter(extCtx, INIT_PARAM_PRETTY_HTML, |
278 | |
INIT_PARAM_PRETTY_HTML_DEFAULT)); |
279 | 0 | myfacesConfig.setAllowJavascript(getBooleanInitParameter(extCtx, INIT_PARAM_ALLOW_JAVASCRIPT, |
280 | |
INIT_PARAM_ALLOW_JAVASCRIPT_DEFAULT)); |
281 | |
|
282 | 0 | myfacesConfig.setRenderClearJavascriptOnButton(getBooleanInitParameter(extCtx, INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON, |
283 | |
INIT_PARAM_RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON_DEFAULT)); |
284 | |
|
285 | 0 | myfacesConfig.setRenderHiddenFieldsForLinkParams(getBooleanInitParameter(extCtx, INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS, |
286 | |
INIT_PARAM_RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS_DEFAULT)); |
287 | |
|
288 | 0 | myfacesConfig.setSaveFormSubmitLinkIE(getBooleanInitParameter(extCtx, INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE, |
289 | |
INIT_PARAM_SAVE_FORM_SUBMIT_LINK_IE_DEFAULT)); |
290 | |
|
291 | 0 | myfacesConfig.setReadonlyAsDisabledForSelect(getBooleanInitParameter(extCtx, INIT_READONLY_AS_DISABLED_FOR_SELECT, |
292 | |
INIT_READONLY_AS_DISABLED_FOR_SELECT_DEFAULT)); |
293 | 0 | myfacesConfig.setRenderViewStateId(getBooleanInitParameter(extCtx, INIT_PARAM_RENDER_VIEWSTATE_ID, |
294 | |
INIT_PARAM_RENDER_VIEWSTATE_ID_DEFAULT)); |
295 | 0 | myfacesConfig.setStrictXhtmlLinks(getBooleanInitParameter(extCtx, INIT_PARAM_STRICT_XHTML_LINKS, |
296 | |
INIT_PARAM_STRICT_XHTML_LINKS_DEFAULT)); |
297 | |
|
298 | 0 | myfacesConfig.setConfigRefreshPeriod(getLongInitParameter(extCtx, INIT_PARAM_CONFIG_REFRESH_PERIOD, |
299 | |
INIT_PARAM_CONFIG_REFRESH_PERIOD_DEFAULT)); |
300 | |
|
301 | 0 | myfacesConfig.setViewStateJavascript(getBooleanInitParameter(extCtx, INIT_PARAM_VIEWSTATE_JAVASCRIPT, |
302 | |
INIT_PARAM_VIEWSTATE_JAVASCRIPT_DEFAULT)); |
303 | |
|
304 | 0 | myfacesConfig.setDelegateFacesServlet(extCtx.getInitParameter(INIT_PARAM_DELEGATE_FACES_SERVLET)); |
305 | |
|
306 | 0 | if (TOMAHAWK_AVAILABLE) |
307 | |
{ |
308 | 0 | myfacesConfig.setDetectJavascript(getBooleanInitParameter(extCtx, INIT_PARAM_DETECT_JAVASCRIPT, |
309 | |
INIT_PARAM_DETECT_JAVASCRIPT_DEFAULT)); |
310 | 0 | myfacesConfig.setAutoScroll(getBooleanInitParameter(extCtx, INIT_PARAM_AUTO_SCROLL, |
311 | |
INIT_PARAM_AUTO_SCROLL_DEFAULT)); |
312 | |
|
313 | 0 | myfacesConfig.setAddResourceClass(getStringInitParameter(extCtx, INIT_PARAM_ADD_RESOURCE_CLASS, |
314 | |
INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT)); |
315 | 0 | myfacesConfig.setResourceVirtualPath(getStringInitParameter(extCtx, INIT_PARAM_RESOURCE_VIRTUAL_PATH, |
316 | |
INIT_PARAM_RESOURCE_VIRTUAL_PATH_DEFAULT)); |
317 | |
|
318 | 0 | myfacesConfig.setCheckExtensionsFilter(getBooleanInitParameter(extCtx, INIT_CHECK_EXTENSIONS_FILTER, |
319 | |
INIT_CHECK_EXTENSIONS_FILTER_DEFAULT)); |
320 | |
} |
321 | |
else |
322 | |
{ |
323 | 0 | if (log.isInfoEnabled()) |
324 | |
{ |
325 | 0 | log.info("Tomahawk jar not available. Autoscrolling, DetectJavascript, AddResourceClass and CheckExtensionsFilter are disabled now."); |
326 | |
} |
327 | |
} |
328 | |
|
329 | 0 | if(RI_IMPL_AVAILABLE) |
330 | |
{ |
331 | 0 | if(log.isInfoEnabled()) |
332 | |
{ |
333 | 0 | log.info("Starting up Tomahawk on the RI-JSF-Implementation."); |
334 | |
} |
335 | |
} |
336 | |
|
337 | 0 | if(MYFACES_IMPL_AVAILABLE) |
338 | |
{ |
339 | 0 | if(log.isInfoEnabled()) |
340 | |
{ |
341 | 0 | log.info("Starting up Tomahawk on the MyFaces-JSF-Implementation"); |
342 | |
} |
343 | |
} |
344 | |
|
345 | 0 | if(RI_IMPL_AVAILABLE && MYFACES_IMPL_AVAILABLE) |
346 | |
{ |
347 | 0 | log.error("Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations."); |
348 | |
} |
349 | 0 | return myfacesConfig; |
350 | |
} |
351 | |
|
352 | |
private static boolean getBooleanInitParameter(ExternalContext externalContext, |
353 | |
String paramName, |
354 | |
boolean defaultValue) |
355 | |
{ |
356 | 0 | String strValue = externalContext.getInitParameter(paramName); |
357 | 0 | if (strValue == null) |
358 | |
{ |
359 | 0 | if (log.isInfoEnabled()) log.info("No context init parameter '" + paramName + "' found, using default value " + defaultValue); |
360 | 0 | return defaultValue; |
361 | |
} |
362 | 0 | else if (strValue.equalsIgnoreCase("true") || strValue.equalsIgnoreCase("on") || strValue.equalsIgnoreCase("yes")) |
363 | |
{ |
364 | 0 | return true; |
365 | |
} |
366 | 0 | else if (strValue.equalsIgnoreCase("false") || strValue.equalsIgnoreCase("off") || strValue.equalsIgnoreCase("no")) |
367 | |
{ |
368 | 0 | return false; |
369 | |
} |
370 | |
else |
371 | |
{ |
372 | 0 | if (log.isWarnEnabled()) log.warn("Wrong context init parameter '" + paramName + "' (='" + strValue + "'), using default value " + defaultValue); |
373 | 0 | return defaultValue; |
374 | |
} |
375 | |
} |
376 | |
|
377 | |
private static String getStringInitParameter(ExternalContext externalContext, |
378 | |
String paramName, |
379 | |
String defaultValue) |
380 | |
{ |
381 | 0 | String strValue = externalContext.getInitParameter(paramName); |
382 | 0 | if (strValue == null) |
383 | |
{ |
384 | 0 | if (log.isInfoEnabled()) log.info("No context init parameter '" + paramName + "' found, using default value " + defaultValue); |
385 | 0 | return defaultValue; |
386 | |
} |
387 | |
|
388 | 0 | return strValue; |
389 | |
} |
390 | |
|
391 | |
private static long getLongInitParameter(ExternalContext externalContext, |
392 | |
String paramName, |
393 | |
long defaultValue) { |
394 | 0 | String strValue = externalContext.getInitParameter(paramName); |
395 | 0 | if (strValue == null) |
396 | |
{ |
397 | 0 | if (log.isInfoEnabled()) log.info("No context init parameter '" +paramName +"' found, using default value " +defaultValue); |
398 | 0 | return defaultValue; |
399 | |
} |
400 | |
else |
401 | |
{ |
402 | |
try { |
403 | 0 | return Long.parseLong(strValue); |
404 | 0 | } catch (NumberFormatException e) { |
405 | 0 | if (log.isWarnEnabled()) log.warn("Wrong context init parameter '" + paramName + "' (='" + strValue + "'), using default value " + defaultValue); |
406 | |
} |
407 | 0 | return defaultValue; |
408 | |
} |
409 | |
} |
410 | |
|
411 | |
private void setResourceVirtualPath( String resourceVirtualPath ) |
412 | |
{ |
413 | 0 | this._resourceVirtualPath = resourceVirtualPath; |
414 | 0 | } |
415 | |
|
416 | |
public String getResourceVirtualPath() |
417 | |
{ |
418 | 0 | return this._resourceVirtualPath; |
419 | |
} |
420 | |
|
421 | |
public boolean isPrettyHtml() |
422 | |
{ |
423 | 0 | return _prettyHtml; |
424 | |
} |
425 | |
|
426 | |
private void setPrettyHtml(boolean prettyHtml) |
427 | |
{ |
428 | 0 | _prettyHtml = prettyHtml; |
429 | 0 | } |
430 | |
|
431 | |
public boolean isDetectJavascript() |
432 | |
{ |
433 | 0 | return _detectJavascript; |
434 | |
} |
435 | |
|
436 | |
private void setDetectJavascript(boolean detectJavascript) |
437 | |
{ |
438 | 0 | _detectJavascript = detectJavascript; |
439 | 0 | } |
440 | |
|
441 | |
private void setReadonlyAsDisabledForSelect(boolean readonlyAsDisabledForSelect) |
442 | |
{ |
443 | 0 | _readonlyAsDisabledForSelect = readonlyAsDisabledForSelect; |
444 | 0 | } |
445 | |
|
446 | |
public boolean isReadonlyAsDisabledForSelect() |
447 | |
{ |
448 | 0 | return _readonlyAsDisabledForSelect; |
449 | |
} |
450 | |
|
451 | |
|
452 | |
public long getConfigRefreshPeriod() |
453 | |
{ |
454 | 0 | return _configRefreshPeriod; |
455 | |
} |
456 | |
|
457 | |
public void setConfigRefreshPeriod(long configRefreshPeriod) |
458 | |
{ |
459 | 0 | _configRefreshPeriod = configRefreshPeriod; |
460 | 0 | } |
461 | |
|
462 | |
|
463 | |
|
464 | |
|
465 | |
|
466 | |
|
467 | |
|
468 | |
|
469 | |
|
470 | |
|
471 | |
|
472 | |
|
473 | |
|
474 | |
public boolean isRenderViewStateId() { |
475 | 0 | return _renderViewStateId; |
476 | |
} |
477 | |
|
478 | |
public void setRenderViewStateId(boolean renderViewStateId) { |
479 | 0 | _renderViewStateId = renderViewStateId; |
480 | 0 | } |
481 | |
|
482 | |
|
483 | |
|
484 | |
|
485 | |
|
486 | |
|
487 | |
|
488 | |
|
489 | |
|
490 | |
|
491 | |
|
492 | |
|
493 | |
|
494 | |
|
495 | |
|
496 | |
public boolean isStrictXhtmlLinks() { |
497 | 0 | return _strictXhtmlLinks; |
498 | |
} |
499 | |
|
500 | |
public void setStrictXhtmlLinks(boolean strictXhtmlLinks) { |
501 | 0 | _strictXhtmlLinks = strictXhtmlLinks; |
502 | 0 | } |
503 | |
|
504 | |
public boolean isTomahawkAvailable() |
505 | |
{ |
506 | 0 | return TOMAHAWK_AVAILABLE; |
507 | |
} |
508 | |
|
509 | |
public boolean isMyfacesImplAvailable() |
510 | |
{ |
511 | 0 | return MYFACES_IMPL_AVAILABLE; |
512 | |
} |
513 | |
|
514 | |
public boolean isRiImplAvailable() |
515 | |
{ |
516 | 0 | return RI_IMPL_AVAILABLE; |
517 | |
} |
518 | |
|
519 | |
|
520 | |
|
521 | |
|
522 | |
|
523 | |
|
524 | |
public boolean isAllowJavascript() |
525 | |
{ |
526 | 0 | return _allowJavascript; |
527 | |
} |
528 | |
|
529 | |
private void setAllowJavascript(boolean allowJavascript) |
530 | |
{ |
531 | 0 | _allowJavascript = allowJavascript; |
532 | 0 | } |
533 | |
|
534 | |
public boolean isAutoScroll() |
535 | |
{ |
536 | 0 | return _autoScroll; |
537 | |
} |
538 | |
|
539 | |
private void setAutoScroll(boolean autoScroll) |
540 | |
{ |
541 | 0 | _autoScroll = autoScroll; |
542 | 0 | } |
543 | |
|
544 | |
private void setAddResourceClass(String addResourceClass) |
545 | |
{ |
546 | 0 | _addResourceClass = addResourceClass; |
547 | 0 | } |
548 | |
|
549 | |
public String getAddResourceClass() |
550 | |
{ |
551 | 0 | return _addResourceClass; |
552 | |
} |
553 | |
|
554 | |
|
555 | |
|
556 | |
|
557 | |
|
558 | |
public static String getAddResourceClassFromServletContext(ServletContext servletContext) |
559 | |
{ |
560 | 0 | String addResourceClass = servletContext.getInitParameter(INIT_PARAM_ADD_RESOURCE_CLASS); |
561 | |
|
562 | 0 | return addResourceClass == null ? INIT_PARAM_ADD_RESOURCE_CLASS_DEFAULT : addResourceClass; |
563 | |
} |
564 | |
|
565 | |
|
566 | |
|
567 | |
|
568 | |
public boolean isCheckExtensionsFilter() |
569 | |
{ |
570 | 0 | return _checkExtensionsFilter; |
571 | |
} |
572 | |
|
573 | |
public void setCheckExtensionsFilter(boolean extensionsFilter) |
574 | |
{ |
575 | 0 | _checkExtensionsFilter = extensionsFilter; |
576 | 0 | } |
577 | |
|
578 | |
|
579 | |
|
580 | |
|
581 | |
public boolean isViewStateJavascript() |
582 | |
{ |
583 | 0 | return _viewStateJavascript; |
584 | |
} |
585 | |
|
586 | |
private void setViewStateJavascript(boolean viewStateJavascript) |
587 | |
{ |
588 | 0 | _viewStateJavascript = viewStateJavascript; |
589 | 0 | } |
590 | |
|
591 | |
public void setRenderClearJavascriptOnButton( |
592 | |
boolean renderClearJavascriptOnButton) |
593 | |
{ |
594 | 0 | _renderClearJavascriptOnButton = renderClearJavascriptOnButton; |
595 | 0 | } |
596 | |
|
597 | |
|
598 | |
|
599 | |
|
600 | |
|
601 | |
|
602 | |
|
603 | |
|
604 | |
|
605 | |
public boolean isRenderClearJavascriptOnButton() |
606 | |
{ |
607 | 0 | return _renderClearJavascriptOnButton; |
608 | |
} |
609 | |
|
610 | |
public boolean isRenderHiddenFieldsForLinkParams() |
611 | |
{ |
612 | 0 | return renderHiddenFieldsForLinkParams; |
613 | |
} |
614 | |
|
615 | |
public void setRenderHiddenFieldsForLinkParams( |
616 | |
boolean renderHiddenFieldsForLinkParams) |
617 | |
{ |
618 | 0 | this.renderHiddenFieldsForLinkParams = renderHiddenFieldsForLinkParams; |
619 | 0 | } |
620 | |
|
621 | |
public void setSaveFormSubmitLinkIE(boolean saveFormSubmitLinkIE) |
622 | |
{ |
623 | 0 | _saveFormSubmitLinkIE = saveFormSubmitLinkIE; |
624 | 0 | } |
625 | |
|
626 | |
|
627 | |
|
628 | |
|
629 | |
|
630 | |
|
631 | |
|
632 | |
public boolean isSaveFormSubmitLinkIE() |
633 | |
{ |
634 | 0 | return _saveFormSubmitLinkIE; |
635 | |
} |
636 | |
|
637 | |
public String getDelegateFacesServlet() |
638 | |
{ |
639 | 0 | return _delegateFacesServlet; |
640 | |
} |
641 | |
|
642 | |
public void setDelegateFacesServlet(String delegateFacesServlet) |
643 | |
{ |
644 | 0 | _delegateFacesServlet = delegateFacesServlet; |
645 | 0 | } |
646 | |
} |