wood burning stoves 2.0*
The moose likes Websphere and the fly likes Cloning a portlet Vs Defining it in portlet.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Cloning a portlet Vs Defining it in portlet.xml" Watch "Cloning a portlet Vs Defining it in portlet.xml" New topic

Cloning a portlet Vs Defining it in portlet.xml

Srini Kesavan

Joined: Jan 18, 2003
Posts: 18

I am wondering which will be a better option in terms of server resources.
If there is a portlet called WeatherPortlet and if I want to create another portlet called CanadaWeatherPortlet. Which option is better
1) Clone the Weather Portlet to create CanadaWeatherPortlet OR
2) Define another portlet (CanadaWeatherPortlet) in portlet.xml

Thanks in advance

Christian Nicoll
Ranch Hand

Joined: Mar 09, 2008
Posts: 106
Hi Srini,
I think neither of those proposals is a good idea, because in each way you'll 've a lot of duplicated code.

I would create just one portlet, the WeatherPortlet. If I've the requirement, that on page A this portlet has to be the CanadianWeatherPortlet and on page B you need a USAWeatherPortlet, then I would define a (country- or locale-)parameter. To create your pages A and B, and to set specific country-parameter for your portlet(-instances) you can create an XMLAccess-Script.

Best regards,

My SCBCD-Notes - My Hello World Webservice
subject: Cloning a portlet Vs Defining it in portlet.xml
Similar Threads
constructor in my controller is called twice, the setter only once
linking jsp pages in a liferay portlet
Required, sample of a portlet supporting both events (publishing & processing).
Please explain the portlet directory structure for me
Settings for portlet