portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Serge Huber <shub...@jahia.com>
Subject New bridge proposal : supporting legacy servlets
Date Thu, 17 Mar 2005 15:28:28 GMT

Hi all,

I've been working the last few days on a new bridge. Basically the main 
goal is : how to rapidly convert existing servlet applications into 

I've looked at the GenericServletPortlet, but it didn't seem to offer 
much in the way of supporting legacy portlets. Just to make sure I'm 
clear, when I talk about legacy servlets what I mean is any kind of 
servlet-based application, that hasn't necessarily been designed to run 
as a portlet. I do also of course realize that this might not be the 
ideal solution for every case, but the goal was to offer a transitional 
technology, a bridge, that would ease the conversion, waiting for the 
application to be rewritten into a real JSR-168 compliant portlet.

In theory this bridge should be able to support any kind of servlet 
application, from Struts applications to servlet only apps. My main 
focus is not Struts webapps as we already have an excellent solution 
with the current Struts bridge. I'm mostly focusing on supporting the 
"rest" of servlet applications. At my company, we have quite a few of 
these, and we wanted to have a way to integrate with J2 without having 
to rewrite everything at once, but just be able to migrate progressively 
to JSR-168 portlets. Anyway I think you catch the drift :)

I've started a small implementation of the bridge, and here is an 
overview of the features :
- Based on the PHP/Perl bridges, I'm also rewriting URLs dynamically.
- Added possibility to "bypass" URL rewriting, for example for download 
URLs, etc, using a special marker
- Support for redirects (kinda hacky, I'm using Javascript redirects to 
achieve this)

How it works :
I use a combination of a portlet and a servlet to handle the dispatching 
to the web application.
- The portlet handles all the portal specific code
- The servlet creates request/response/session wrapper classes to 
intercept everything needed
- The servlet checks for redirects and generates Javascript redirect if 
- The portlet retrieves the output, parses the HTML to rewrite all URLs, 
and sends the modified HTML to the response.

The code is still very young, and a little hacky, but if you want to 
have a look I've quickly put up a ZIP with just the classes here : 
http://www.jahia.org/~loom/legacy-servlet-bridge-20050317-1618.zip .

If there is an interest I'd be ready to contribute this bridge to the 
project. I'd welcome feedback, discussion, huge sums of money or 
anything else this inspires you.

  Serge Huber.

To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org

View raw message