aspose file tools*
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 Spring in Action this week in the Spring 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
Author

Cloning a portlet Vs Defining it in portlet.xml

Srini Kesavan
Greenhorn

Joined: Jan 18, 2003
Posts: 18

Folks,
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


SCDJWS,SCWCD,SCJP
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,
Christian


SCJP 5, SCJD 5, SCWCD 5, SCBCD 5, SCJDWS 5
My SCBCD-Notes - My Hello World Webservice
 
 
subject: Cloning a portlet Vs Defining it in portlet.xml