views:

291

answers:

6

It's been suggested that this might be a reasonable approach, in order to minimize changes to an existing server configurations, but is it actually valid/supported? I've not been able to find anything specific either way.

In practice, with a JBoss Portal V2.4.2 server, there appears to be some class-loading issues, so things such as the downloadable Stripes example or a standard Wicket quickstart app don't run, but I'm not sure if the problem there is a server-specific one or a generic one - Anyone?

Note: This isn't about displaying/moving an existing web-app into a portal, simply if a Portal Server should also be a valid AppServer?

A: 

I assume that the question has to do whether a standard web application can be rendered as a portlet from a Portlet container. This is not possible. The portlets need to be based on the GenericPortlet class and have special deployment descriptors. There is the JSR-168 standard, which specifies the requirements for the portal. The JSR-286 specification is on the way.

The only thing you could do is to create a portlet that will serve your existing application through an iframe, but this is of course ugly.

There is a free book for portlets called "Portlets and Apache Portals", which could be useful. Consult also the specification. This blog spot is interesting.

kgiannakakis
Thanks - any pointers to where I should be looking to find this defined, as I'm going to have to persuade some people who believe this is a valid thing to do?
Gwyn Evans
No, the question's about if a Portal Container should be able to act as a standard AppServer, simply serving a 'standard' web-app as a web-app in the same way that (e.g.) Tomcat would be able to.As I said, the installed server I have access to fails, but it's seeming as if that's specific to it...
Gwyn Evans
A: 

From my experience that is a valid suggestion. Portlet Apps are often also Webapps (they might contain a servlet for example to allow access to application logic also by links to be rendered in one of the portlets), so they contain both portlet.xml and web.xml and need j2ee classes and jsr168 classes. The WSRP standard also contains resource link type with is supposed to represent a normal appserver for the remote server.

Websphere portal server is also an app server.

Arne Burmeister
A portlet application is indeed deployed in a War file and can contain servlets. I assumed that the question was if an existing application can be rendered as a portltet from the Portal Server. This is of course not possible.
kgiannakakis
Hmm... but can it /exclusively/ contain servlets, or in other words, does an app need to have at least 1 portlet? (I don't have/want to serve a portlet, just a servlet, but I've only got a Portal Server!)
Gwyn Evans
to kgiannakakis: right, you would need a bridge portlet to render normal servlet content into a portlet, see portletbridge.org
Arne Burmeister
to Gwyn: the app need to contain a portlet.xml, but the file may consist just of an empty portlet-app tag. But i dont know whether your container will allow this.
Arne Burmeister
A: 

I have mixed servlets and portlets in a single web application using JBoss Portal, BEA WebLogic Portal and Apache Jetspeed 2.

However, converting a servlet to a portlet can be difficult. Using bridging technology such as Portals Bridges do exist but I have been lucky enough to avoid having to do such a conversion and have no direct experience other than playing with the tutorials.

bmatthews68
+2  A: 

JSR 286 (Portlet 2.0) spec:

PLT.2.7

Relationship with Java 2 Platform, Standard and Enterprise Edition

The Portlet API v2.0 is based on the Java Platform, Standard Edition 5.0 and Enterprise Edition v1.4. Portlet containers should at least meet the requirements, described in v 1.4 of the J2EE Specification, for executing in a J2EE environment.

It is therefore not unreasonable to expect standard app-server applications to work under a portal.

However, by definition, a portal is going to include more libraries in the global class space. Adding libraries to the container always introduces the risk of incompatibility and the need to manage what classes/resources are exposed to your application and how (application-first class-loading, etcetera). I've had problems in the past with third part libraries whose dependencies conflicted with a version that shipped with the portal. I wouldn't expect dependency management to get any easier.

Write once, test everywhere, as they say.

McDowell
A: 

Hmm... but can it /exclusively/ contain servlets, or in other words, does an app need to have at least 1 portlet? (I don't have/want to serve a portlet, just a servlet, but I've only got a Portal Server!)

Even if the application contains a portlet, nothing says you need to expose that portlet on a page somewhere. If you write such an application, simply author as many servlets as you wish, link to them directly and not place any dummy/default portlet on any page anywhere.

I wrote a JSR-168 compliant app with an empty portlet and a servlet that was used to retrieve some XML stock price data. For several months all that was ever invoked was the servlet, the portlet was never visible anywhere on the site. Later I added a portlet which provided some additional data from the XML feed.

Grant Wagner
A: 

The answer is that yes, it is valid, but the specific JBoss Portal V2.4.* versions appear to have class-loader issues such that only the more basic web-apps will run correctly.

Gwyn Evans