3

I need help with regard to Facelets and specifically the jsfc attribute in HTML tags. I am having difficulty getting understanding if the following will work.

<head jsfc="h:head"> <ui:insert name="head"/> <base href="http://localhost:8080/Jerel-Baker/"/> <link jsfc="h:link" rel='stylesheet' type='text/css' href='styles/style.css'/> <link jsfc="h:link" rel='stylesheet' media='screen and (max-width: 700px)' href='styles/narrow.css' type="text/css"/> <link rel='stylesheet' media='screen and (min-width: 701px) and (max-width: 900px)' href='styles/medium.css' type="text/css"/> <link rel='stylesheet' media='screen and (min-width: 901px)' href="styles/wide.css" type="text/css"/> <title>#{msg.title}</title> </head> 

When I put a jsfc="h:link" in each of my link elements, the css is not rendered. I would greatly appreciate any help.

1 Answer 1

3

I'm not sure how it's useful to use jsfc in a plain vanilla output component. At least, the HTML <link rel="stylesheet"> is in JSF not represented by a <h:link>, but by <h:outputStylesheet>. The <h:link> renders a HTML <a> element. Technically, you should be using jsfc="h:ouputStylesheet" instead. I'd just get rid of the attribute since it adds nothing extra here.

Sign up to request clarification or add additional context in comments.

1 Comment

Hi BalusC & thank you. I noticed this yes that the h:link renders an anchor <a>. I my be the only one using this approach, but what I like to do, is code plain xhtml templates and then convert them to jsf when I amhappy that they look good. It would be great if there were a Java based IDE with a wysiwyg editor that supported both Java fully and html languages/css. That being said I am glad I am not one of these guys who use Dreamweaver as it certainly helps to understand how to write raw code.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.