Search code examples
javacode-reusewebsphere-portalspring-portlet-mvc

Spring MVC Portlet reuse in Websphere Portal


I have application in which there are several portlets created, simple java mvc portlet. Is it possible to reuse the portlet in another application, without duplicating code? What are the implications and what changes should be done?

Thank you.


Solution

  • If you have a portlet it can be deployed in many different ways. You can deploy the same portlet without code changes into multiple environments.

    Once the portlet is deployed in an environment you can also:

    • Clone it, ie make a copy of it, which will allow you to change the portlet configuration without making two separate portlets.
    • Use the same portlet on different pages (multiple instances).

    All of the above without doing any changes to the actual portlet. Now, keep in mind that it also all depends on the portlet. If the developers of the portlet have included many hard coded parameters, this may not be possible to do. I recommend that you keep the server/environment dependent parts in configurations rather than hard coded.