131 total views, 4 views today
JSF OutputStylesheet Example
The JSF OutputStyleSheet renders an HTML <link> tag of type “text/css”. Below is the
h:OutputStylesheet and its corresponding HTML tags.
JSF => <h:outputStylesheet name=”style/template.css” />
HTML => <link type=”text/css” rel=”stylesheet” href=”/JSF_OutputStylesheet_Example/faces/javax.faces.resource/style/template.css” />
JSF h:OutputStylesheet Example
Create a folder ‘resources’ under WebContent directory and place the CSS files over there as shown below. Below are the style.css and the index.xhtml file
Highlight-1). The style/template.css file is residing under the resources directory
Highlight-2). The JSF <H:ouputStylesheet> pointing to the stylesheet
Highlight-3) The button component has the styleClass attribute which is a CSS class present in the template.css
Below is the content of the template.css file. The CSS class sets background color Yellow.
Below is how the page looks like in the browser
Download the JSF Project:
The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.
Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂
Latest posts by Govind
- How to encode and decode base64Binary datatype in Oracle BPEL - December 11, 2017
- How to Read a File using Oracle BPEL File Adapter Example - December 11, 2017
- How to write a File using Oracle BPEL File Adapter Example - December 10, 2017