Our website skill-guru
has dynamic contents. So we have lots of test and quiz and each page has this at top
The keywords开发者_JS百科 and description has to be unique for each test page.
meta name="keywords" content="keyword 1 , keyword 2"
meta name="description" content="The description goes here"
How can we set this dynamically ?
This is JSF based web application
Just use <h:outputText>
the usual way to output text dynamically:
<meta name="keywords" content="<h:outputText value="#{bean.keywords}" />" />
Or, if you're using <f:loadBundle>
to maintain localized text:
<meta name="keywords" content="<h:outputText value="#{bundle.keywords}" />" />
Of course the particular line must be enclosed in a <f:view>
to get it to work. Just wrap the whole <html>
inside <f:view>
then.
精彩评论