aspose file tools*
The moose likes Struts and the fly likes JSF & style sheets (css) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "JSF & style sheets (css)" Watch "JSF & style sheets (css)" New topic
Author

JSF & style sheets (css)

Santosh Ramachandrula
Ranch Hand

Joined: Apr 04, 2004
Posts: 252
Hi folks!!
1. How can we use css (cascading style sheets) with JSF?
If yes can anyone post a simple example?
2. Is it possbile to use java script with JSF?



Thanks,
Santosh
Santosh Ramachandrula
Ranch Hand

Joined: Apr 04, 2004
Posts: 252
Any takers for this question ?
Hans Bergsten
Author
Ranch Hand

Joined: Dec 01, 2003
Posts: 106
Originally posted by Santosh Ram:
Hi folks!!
1. How can we use css (cascading style sheets) with JSF?
If yes can anyone post a simple example?
2. Is it possbile to use java script with JSF?



Yes, you can use both CSS and JavaScript with JSF.

CSS is very easy. All JSF components render an HTML element with a "class" and/or "style" attribute that you define. For instance, using the JSP tag libraries:

Just the define the styling you want for the class in a regular style sheet, included or referenced from the page.

JavaScript can either be created manually and included or referenced from the page, or generated automatically by JSF component renderers.

You may want to read the spec, or a book (hint, hint), to learn more. There are also plenty of articles and tutorials online. Good places to start are:

http://java.sun.com/j2ee/javaserverfaces/
http://jamesholmes.com/JavaServerFaces/

You may also get quicker responses to your JSF questions in Sun's JSF forum:

http://forum.java.sun.com/forum.jsp?forum=427


Hans Bergsten, hans@gefionsoftware.com<br />Author of O'Reilly's<br />- JavaServer Pages,<br />- JavaServer Faces<br /><a href="http://www.hansbergsten.com/" target="_blank" rel="nofollow">http://www.hansbergsten.com/</a>
Santosh Ramachandrula
Ranch Hand

Joined: Apr 04, 2004
Posts: 252
Thanks Hans!!

As JSF uses tag I had a double it can take the stylesheet arrtibute.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF & style sheets (css)