How Portlet title is calculated

Does it ever happened to you that you deployed a portlet and then you noticed that there was spelling mistake in the Portlet title, you try changing the title in portlet.xml but it does not affect the title that is getting displayed. I had that problem some time back so i debugged to figure out how the portlet title gets calculated.

The Portlet title can be set in one of the three different places

1) Highest priority is given to the Portlet title set/overriden in the Manage Portlet


2) If you havent changed the Portlet title in Manage Portlet, portlet then second priority is given to the value of javax.portlet.title property in the portlets resource bundle.

javax.portlet.title=Title from properties is changed
javax.portlet.short-title=TitleTestPortlet
javax.portlet.keywords=TitleTestPortlet

then in the portlet.xml file the resource bundle is defined like this.

<resource-bundle>com.ibm.titletestportlet.nl.TitleTestPortletResource</resource-bundle>


3)If you havent over ridden title in the portlet title in the Portal Admin Console or you havent specified in the Resource bundle in the portlet.xml then it will be pick up from the portlet.xml


<portlet-info>
<title>TitleTestPortlet</title>
<short-title>TitleTestPortlet</short-title>
<keywords>TitleTestPortlet</keywords>
</portlet-info>

1 comment:

Anonymous said...

and what priority is given to setTitle() method in render response?