1

In my project, I have a main template page main_template.xhtml that has all the resource file includes.

I have a styles.css in the main template that contains styling classes of my pages. In one particular page I want to exclude the styles.css resource file, how can I achieve that?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Shahe
  • 964
  • 2
  • 13
  • 34

1 Answers1

1

As every other UI component, the <h:outputStylesheet> also supports the rendered attribute. You can grab the current view ID by UIViewRoot#getViewId() and just check on that.

So, pieces put together that would look like:

<h:outputStylesheet ... rendered="#{view.viewId ne '/specific.xhtml'}" />

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555