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

external Stylesheet .css file in JSF

 
Anand Gondhiya
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am trying to include a external stylesheet file in the JSF page. But It is not applying any styles. can anyone give any ideas ?

Thanks
- Anand

 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For that to work properly, you probably would need to escape it with <f:verbatim>. You also have to have the mystyle.css file in the same directory as the JSF page you're displaying. Finally, you have to be careful just where in the view definition you place it.

There's a RichFaces tag that's specially designed to reference CSS and JavaScript, and it additionally handles the relative URLs better than a raw <link> tag does.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic