Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF & style sheets (css)

 
Santosh Ramachandrula
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

 
Santosh Ramachandrula
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any takers for this question ?
 
Hans Bergsten
Author
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Santosh Ramachandrula
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Hans!!

As JSF uses tag I had a double it can take the stylesheet arrtibute.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic