ADF 11g – include meta data tags in HEAD element – using af:document and metaContainer facet
ADF Faces 11g does not contain tags such as af:head and af:body. Instead there is af:document, an abstraction from the documents served to potentially different clients. A JSF page can be rendered as HTML – with a HEAD and BODY tag – but also to other clients and renderformats that do not have the HEAD and BODY concept. Hence the abstraction.
When your ADF Faces page does render as HTML to a web browser, the af:document will render both HEAD and BODY. If you want to specify the title attribute for the HEAD, you have to set the title attribute on af:document.
When you want to set the meta tags in the HEAD section – for example to do some SEO (Search Engine Optimization) you need to use the metaContainer facet of the af:document component. This facet is also used for including JavaScript snippets in the HEAD – see for example this article by Frank Nimphius.
To set the values of meta-tags, you use code like this:
<af:document>
<f:facet name="metaContainer">
<f:verbatim>
<meta name="description" content="Some very interesting bit of meta information about the page" />
<meta name="keywords" content="money profit huge pile gold treasure rich filthy rich happy few" />
</f:verbatim>
</f:facet>
Note that the f:verbatim is one way of dealing with the fact that <meta> is not a recognized nor allowed child of a facet or any other JSF component.
Thanks Daan for collaborating on this one.
Related posts:
- Meta Data Driven User Interface with Dojo and Spring MVC
- Cost Based Optimizing through time travel? – the value of meta-data for enabling Query Rewrite
- XSL Transforming XML generated from SQL results using JSTL tags in JSP pages – putting JSTL to the test
- Oracle Designer/Oracle SCM Meta Model
- Building ADF Faces Tree based on POJOs (without using the ADF Tree Data Binding)
This entry was posted by Lucas Jellema on January 13, 2009 at 11:50 pm, and is filed under ADF & JHeadstart, J(2)EE/Java, Oracle, Web. Follow any responses to this post through RSS 2.0.Both comments and pings are currently closed.
-
Comments are closed
- Comment Feed for this Post
- ADF: (Automatic) Partial Page Rendering across Taskflows
- ADF client-side architecture – Select All
- ADF 11.1.1.7 : The return of the paging table (… and more ….)
- ADF DVT Speed Date: Interactive Bubble Graph
- Book Review : Oracle ADF Real World Developer’s Guide
- The ultimate ADF event of 2012: The AMIS Master Class Advanced ADF – Christmas Special (Friday 21st of December)
- Maak bij AMIS als eerste kennis met Oracle ADF Mobile!
- ADF Mobile : Your First Navigation and Device Interaction
- ADF Mobile is now Generally Available
- ADF 11g Training Applicatie Ontwikkeling.
But what the point? Â It seem to me ADF Faces pages depend heavily on JavaScript to show any content. Â For web crawler, only the <noscript> element is showed and indicate to activate JavaScript. Â Searh engine crawler doesn’t run JavaScript, therefore those pages are not viewable, nor indexable.
Â
What am I missing?