Oracle ADF: Add a Favicon to Page, Page Template

A favicon, also known as a web site icon, tab icon or bookmark icon, most commonly 16×16 pixels, associated with a particular Web site or Web page.
Resources used
-          Jdeveloper IDE  (11.1.2.3.0)
-          Internet Explorer 10 (10.0.9200.16384)
So, how to implement this in Oracle ADF?
It’s simple, take a breath there!

Ø  Create an ADF Application

Ø  Place the favicon image (e.g. used in POC – flower_blue.ico) in the Web Content Root location as depicted in the image below. (FaviconViewController\public_html). For supported image file formats check http://en.wikipedia.org/wiki/Favicon#File_format_support

Ø  Set “smallIconSource” value equal to “ /flower_blue.ico  ” under Appearance of af:document tag.
 
 
Image - 1

Ø  Set the Java EE Application web context root to “ / ” as depicted in Image - 2 if deployed to Integrated Weblogic Server or if deployed to Stand Alone Server change the context root to “ / ” in Deployments as depicted in Image – 3. (Right click ViewController Project and select Project Properties Menu to display this dialog.) 

Note: Sometimes another application may exist with the same context root, so undeploy the application (Refer Image - 5) as displayed in Log Window of IDE to avoid error as displayed in Image - 4


Image - 2
 

Image - 3
 

Image - 4
 
Image – 5 
Ø  The application is successfully deployed as depicted below.
 
Image – 6
 
Ø  The running URL displays the favicon image next to Address Bar & on Tab as depicted below. 
 
Image – 7
 
Ø  When Bookmarked as Favourites, the favicon is displayed. 
 
Image – 8
 
Ø  When the Tab is pinned to Windows Taskbar, it displays before navigation Icons as well as in taskbar as icon as dipicted below.

 
Image – 9
 
Ø  The same URL, when tested on Firefox browser displays favicon as depicted below.


Image – 10

If the same is needed to be achieved using a page template, follow, as stated below

Ø  Design a template, which will be consumed by the pages and also used across the project. (Refer Image – 11, 12, 13)
 

Ø  Drag drop an OutputText component any where on the page template from Component Palette and set the following attributes – escape = “false” & value = [<link REL="SHORTCUT ICON" HREF="http://localhost:7101/flower_blue.ico">], as displayed below. 
 

<af:outputText value='&lt;link REL="SHORTCUT ICON" HREF="http://localhost:7101/flower_blue.ico">' id="pt_ot1" escape="false"/>
 

Ø  The context root need not be “ / ”, it can anything. (Refer Image - 14)

 
Image - 11
 
 
Image - 12
 

Image - 13
 
 
Image – 14
 
Ø  Run the jspx page using the template which we just created, we find it deployed successfully without any error as depicted below.
 
 
Image – 15
 
Ø  Check the URL generated to display, the jspx page developed using page template including the favicon, as depicted below.
 
 
Image - 16 

 

Comments

Post a Comment

Popular posts from this blog

Oracle ADF : Dynamic Regions

Oracle ADF : Working with Parameters