tags:

views:

27

answers:

1

Our website skill-guru

has dynamic contents. So we have lots of test and quiz and each page has this at top

The keywords 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

+1  A: 

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.

BalusC
That is a good suggestion. let me try that.
vsingh