Serge Huber wrote:

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 portlets.

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 needed
- 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.

Regards,
 Serge Huber.

Im wondering if any of the Struts bridge can also be leveraged here.

Looking at the HTMLPostProcess class, and it looks to me like it doesn't use the rewriter framework that Perl/PHP use, but instead uses straight Java logic and string processing.


-- David Sean Taylor Bluesunrise Software [EMAIL PROTECTED] [office] +01 707 773-4646 [mobile] +01 707 529 9194

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to