Public Render Parameter

The JSR 286 specification introduces concept of Public Render paramter which are same as the render paramter before with a differnece that they can be shared across portlets. Your portlet code for setting render parameter in the URL and reading it remains same, only difference is you declare a render parameter in the portlet.xml and then they are shared across different portlets

I built two sample portlet one is WeatherPortlet and other is MapPortlet, they do nothing but set zip as render parameter and read zip parameter and display it in view mode, this is how my WeatherPorltet looks like

public class WeatherPortlet extends GenericPortlet{
protected void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException {
System.out.println("Entering WeatherPortlet.doView()");
response.getWriter().println("Value of zip render parameter " +

PortletURL sfoWeather = response.createRenderURL();
sfoWeather.setParameter("zip", "94101");
response.getWriter().println("<a href='"+ sfoWeather.toString()+"'>SFO</a>");

PortletURL puneWeather = response.createRenderURL();
puneWeather.setParameter("zip", "411007");
response.getWriter().println("<a href='"+
System.out.println("Exiting WeatherPortlet.doView()");

The MapPortlet is same as that of the WeatherPortlet. Now the next part is in the portlet.xml i declare zip as public render parameter and now if i set zip parameter in map it gets available to weather and other way round

<?xml version="1.0" encoding="UTF-8"?>
<portlet-app xmlns=""
version="2.0" xmlns:xsi=""
<display-name>Weather Portlet</display-name>
<title>Weather Portlet</title>
<short-title>Weather Portlet</short-title>
<display-name>MapPortlet Portlet</display-name>
<title>MapPortlet Portlet</title>
<short-title>MapPortlet Portlet</short-title>

<qname xmlns:x="">x:zip</qname>


In WebSphere once you set zip render parameter it remains in the URL until you logout and login again, if you add the Weather and Map portlet on different pages then zip code set on one page is available on other


Anonymous said...

Can you please tell what is the scope of public render parameter? Is it session scope or request scope?

srjwebsolutions said...

We are leading responsive website designing and development company in Noida.
We are offering mobile friendly responsive website designing, website development, e-commerce website, seo service and sem services in Noida.

Responsive Website Designing Company in Noida
Website Designing Company in Noida
SEO Services in Noida
SMO Services in Noida

Vikas Chaudhary said...

Battery Mantra is Authorized exide car battery dealer in Noida and Greater Noida. We are providing our service in Indirapuram, Delhi, Ashok Nagar.

Exide Battery Dealer in Noida
Battery Dealer in Noida
Authorized Battery Dealer in Noida
Car Battery Dealer in Noida
Car Battery Dealer
Exide Battery Dealer

EG MEDI said... is online medical store pharmacy in laxmi nagar Delhi. You can Order prescription/OTC medicines online.
Cash on Delivery available. Free Home Delivery

Online Pharmacy in Delhi
Buy Online medicine in Delhi
Online Pharmacy in laxmi nagar
Buy Online medicine in laxmi nagar
Onine Medical Store in Delhi
Online Medical store in laxmi nagar
Online medicine store in delhi
online medicine store in laxmi nagar
Purchase Medicine Online
Online Pharmacy India
Online Medical Store