In Netbeans I have a sub folder called css and a file in it called testcss.css.
How do I get Facelets file from root to access the testcss.css file?
<meta http-equiv="content-type" content="text/html; charset=windows-1252" />
<link rel="stylesheet" type="text/css" href="/testcss.css" title="style" />
My directory structure is:
Root (not a folder)
css (folder)
testcss.css
A screenshot of the structure is available here.
You should put CSS (and JS and image) resources in
/resourcesfolder (create one if it doesn’t exist).Once accomplished that, you should be able to reference the CSS (and JS and image) resources using the appropriate JSF components
<h:outputStylesheet>(and<h:outputScript>and<h:graphicImage>) as follows:No need to fiddle with relative paths. JSF will automagically generate the proper URL.
See also: