ADF 11g – include meta data tags in HEAD element – using af:document and metaContainer facet

Lucas Jellema 1
0 0
Read Time:1 Minute, 3 Second

 

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:


 
   
     
     
   
 

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.

 

About Post Author

Lucas Jellema

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Kubernetes & Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press book Oracle SOA Suite 12c Handbook. Frequent presenter on user groups and community events and conferences such as JavaOne, Oracle Code, CodeOne, NLJUG JFall and Oracle OpenWorld.
Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

One thought on “ADF 11g – include meta data tags in HEAD element – using af:document and metaContainer facet

  1. 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?

Comments are closed.

Next Post

(Dutch) Dinsdag 20 januari 2009: PL/SQL Potpourri

Aanstaande dinsdag 20 januari 2009 van 16:30 tot 20:30 ben je van harte uitgenodigd bij de PL/SQL Potpourri. Een kennissessie waarbij acht AMIS-consultants in negen korte presentaties iets zullen vertellen over interessante toepassingen van SQL en PL/SQL. In een paar uur wordt je meegenomen in de toepassing van aspecten van […]
%d bloggers like this: