Search code examples
javaliferayportletibm-wasjsr286

Can I create a Java Portal (JSR 168/286) using only an application server (Tomcat, JBoss, etc)?


I want to create a lightweight portal using the Java specification. I want to be able to deploy the same portal project in different application servers (in this case WebSphere, Tomcat and JBoss).

I've checked products like Liferay, but I want to create my own framework and interface, and just embed Java Portlets, instead of using Liferay's full framework and interface.

With IBM WebSphere (not WebSphere Portal), I followed the following guide:

"Exploiting the WebSphere Application Server V6.1 portlet container: Part 1: Introducing the portlet container"

I managed to create a simple JSP embedding two simple portlets. Each of the portlet projects are product agnostic (contrary to Liferay or Apache Pluto projects, which include product-specific configuration files). This is what I want to do.

The problem is that, if I try to run those same projects in Tomcat or JBoss, they are not working. As I said before, the projects doesn't have any IBM or WebSphere specific configuration files.

So, my questions are:

  1. Is there a way to use Java Portlet projects without having to add vendor-specific files or code, and add them to any application server?
  2. Where can I find the guidelines to create application-server-agnostic portlets and portals?
  3. Is it the case that WebSphere has a portlet container but the other servers don't?

Solution

    1. Is there a way to use Java Portlet projects without having to add vendor-specific files or code, and add them to any application server?

    No. The likes of tomcat, jboss etc are Servlet Containers and to run portlets you need Portlet Container which is actually provided by Portals like Liferay etc.

    1. Where can I find the guidelines to create application-server-agnostic portlets and portals?

    JSR specification gives you the guide-lines. Here is a good link for it. Again I repeat Portlets just like Servlets require Servlet Container, they require Portlet Container. But this would be re-inventing the wheel when you already have fully-functional portlet containers like Liferay, IBM etc which are created based on the specifications with lots of additional features. Liferay is a portlet-container which runs on most of the Application servers and if you created a portlet without using any of the vendor-specific API then it should run in all the different portals like Liferay, IBM etc with just adding a few configuration files which are given for additional user experience and features.

    1. Is it the case that WebSphere has a portlet container but the other servers don't?

    Yes. :-) Atleast the article you linked to clearly mentions that it has a portlet container:

    This article series examines the JSR 168 portlet container available in IBM WebSphere Application Server V6.1 and differentiates its use from WebSphere Portal.

    Hope this helps and gets you somewhere.