You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Mikhail Garber <MG...@unifocus.com> on 2004/01/26 15:55:07 UTC

using Struts for portlet development

Hi all
We use Jetspeed as the foundation of our portal. Plain vanilla 1.4.
We decided to use Struts with JSPs for the development of new portlets.
The basic strategy goes like that:
All portlets are based on JSP template and use the same Turbine Action
class.
I extended Struts form tag and Jetspeed portletlink tag to supply additonal
parameter - the URI of the Struts action to run.
The Turbine Action (in the perform method) stores the original "portal-like"
URI in the request object and does RequestDispatcher forward to whatever was
specified as Struts URI.
The Struts action does whatever it supposed to do and at the end extracts
the original Turbine-style URI from the request and does doForward to it.
So far this seems to work and gives us the advantage of using Struts while
still doing work in the Portal.
does anyone else use the same or similar technique? Do you see any problems
with it? 
So far I identitifed a few: for example, I do not know how to get the Struts
action to run during the very first loading of the portlet.
Also the Struts validation (either via validate() or a Validator) does not
work for some reason.

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


Re: using Struts for portlet development

Posted by benja <be...@thales-is.com>.
We are using a different approach for this.

Our application is composed of a set of modules. Each module is developed as
a Struts application without taking in account that finally the module will
be displayed inside a portlet. The main benefit of this is that developers
don't require more skills than usually (Struts, JSPs, ...). Jetspeed is not
in the development environment.

After developing the module, we integrate all the modules in the portal.

Internal module actions (e.g. click on a button inside the panel) are
handled by Struts. The request is processed as usually and the unique
difference is in the forward. After processing the request, instead
displaying the next page,  the control is forwarded to Jetspeed. It will
display the complete portal page.

Actions over the portal (e.g. menu) or over the portlet bar are handled by
Jetspeed. Struts is not aware of these.

Integration basically means move resources (folder with jsp's. struts
config, ...) from development to integration. We have standardized a lot and
this is done automatically. Different behavior in the development env. and
portal env. are handled by different implementations of common classes (e.g.
the forward class performs a classic forward in development but a forward to
the portal in integration).

To do this, we did the following:
- use session to store info about the current page displayed in each portlet
- create the forward that sets this info (write in session the next page to
display) before forwarding to the portal.
- modify HTML Portlet to use this info

The weak points are:
- collaboration between portlets. One action in a portlet modifies the rest
of portlets. The model is more complex due to modules are not isolated.


That's all
Benja



----- Original Message -----
From: "Mikhail Garber" <MG...@unifocus.com>
To: <je...@jakarta.apache.org>
Sent: Monday, January 26, 2004 3:55 PM
Subject: using Struts for portlet development


> Hi all
> We use Jetspeed as the foundation of our portal. Plain vanilla 1.4.
> We decided to use Struts with JSPs for the development of new portlets.
> The basic strategy goes like that:
> All portlets are based on JSP template and use the same Turbine Action
> class.
> I extended Struts form tag and Jetspeed portletlink tag to supply
additonal
> parameter - the URI of the Struts action to run.
> The Turbine Action (in the perform method) stores the original
"portal-like"
> URI in the request object and does RequestDispatcher forward to whatever
was
> specified as Struts URI.
> The Struts action does whatever it supposed to do and at the end extracts
> the original Turbine-style URI from the request and does doForward to it.
> So far this seems to work and gives us the advantage of using Struts while
> still doing work in the Portal.
> does anyone else use the same or similar technique? Do you see any
problems
> with it?
> So far I identitifed a few: for example, I do not know how to get the
Struts
> action to run during the very first loading of the portlet.
> Also the Struts validation (either via validate() or a Validator) does not
> work for some reason.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
>


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