5

Is it preferable to use JSF's h:outputScript or h:outputStylesheet when script/style elements may just work for you ? What advantages does former offer over the latter ?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Rajat Gupta
  • 25,853
  • 63
  • 179
  • 294

2 Answers2

4

The JSF builtin resource handling has at least the following advantages:

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • thanks for all the relevant links.. I want to clarify one thing though.. I make use of omnifaces `CombinedResourceHandler`. Would configuring cache setting using context-param `org.apache.myfaces.RESOURCE_MAX_TIME_EXPIRES` actually work ? – Rajat Gupta Sep 18 '13 at 11:39
2

Normal script/styles work if you know exactly under which context url the application is deployed.

So if you want to deploy the application under another context url you have to change your jsf code if you use script/style instead of h:outputScript and h:outputStylesheet.

René Link
  • 48,224
  • 13
  • 108
  • 140