I need some guidance on the portal approach. If I have a portal application in which all of the portlets(separate war files) are using some framework jars. The framework is the one that my org. follows. Since all the portlets use it can I share it at a common location or I have to put them in the portlet's WEB-INF\lib folder only for all the oirtlets.
Similarly if there are some other jars that are being used by all teh portlets, can I put them in a shared location?
You can put all the common jars in the shared\app\ directory of the portal server.
Thanks & Regards,<br />Hemant K. Sharma
posted 12 years ago
Thanks for the answer, but can you please tell that if suppose the version of the jar changes quite frequently, even then is it advisable to keep in shared/app or should it be in WEB-INF in this case, so that every time the version change happens the portal needn't be rebuit?
posted 12 years ago
If you keep the jar in WEB-INF/lib and the jar is changing frequently, then you will need a fresh deployment (even though there was no change in portlet application) every time the jar is updated.
Its always good to keep common jars in shared/app.
Here's the thing - say you've got xerces1.1.jar in your shared\app folder. Then, one of your 1000 apps wants to use xerces2.0? You've got to update and test ALL 1000 apps before this one app can move.
Alternatively, if each app puts it's xerces jar in its local WEB-INF\lib directory, the app can be upgraded to a newer version without bothering all of the other 1000 apps on the server.
Of course, if all the apps hit the same db2, then the db2 driver should be on the shared\apps folder. For that matter, when you upgrage to a newer version of db2, all apps will have to update at the same time, so there it makes sense.
Indeed, putting things int he web-inf\lib directory will require a re-deploy of the app. Hopefully, though, updating a jar file is a very controlled, and regression-tested process that doesn't happen all that often.
As with most J2EE things, there are no right answers, there are only wrong answers. If you can manage not to get a wrong answer, you're doing good.