[Opensource] does expresso's 'action' servlet cause incompatibilities
with stuts apps?
Peter A. J. Pilgrim
peterp at xenonsoft.demon.co.uk
Tue Oct 29 06:53:04 PST 2002
Mike Traum wrote:
> I've been wondering if expresso will cause issues with struts apps. I'm creating a
> portal system and the best way I know how to do this is to have all of the apps
> under one webapp so they can share a session and easily have an integrated
> login system.
>
> What if I decide to add a pure struts-based app? I know that struts tags
> have been re-written because the expresso Action bean isn't compatible with
> the struts one. Does this cause incompatibilities?
>
There isn't such thing as an Action bean. The `Action' in pure Struts is
subclassed as the `Controller' in Expresso. So Expresso Controller inherit
behaviour from Struts Action, so they are not incompatible. The actions
that exist in your pure Struts application should still be called normally.
This is guaranteed by the concept of `polymorphism'.
package org.apache.struts.action.Action;
public class Action {
public abstract void performAction( ... ) ;
}
package com.jcorporate.expresso.core.controller;
import org.apache.struts.action.Action;
public class Controller {
public void performAction( ... ) {
// Expresso specific stuff
}
}
> mike
Be careful when using the extended expresso struts tags, because
they only work with Expresso Controllers. In fact for the eForum
development I use the pure Struts Beans tags because I placed
a `java.util.List' directly into the HttpSession ( or Expresso's
PersistentSession#setPersistentAttribute ). The potentially
holds the hit list for the search engine plug-in that I
am developing for eForum.
Alternatively I could have extended the `Browse' controller to
write normally Expresso Block / Output / ControllerElements
as described in the EDG. I thought that it
be too much work and potentially too many objects created
per each user query. I can imagine a scenario where
somebody does a search query of ``expresso'' on the
Jcorporate forums. Boom! How many controller elements?
Instead in the JSP view I use the pure `Struts' bean tag to
access the named HITLIST scoped attribute in the HttpSession
scope and run a pure Struts iterate tag over. I still can
render a nice HTML view.
<purelogic:iterate id="hit" name="SEARCH_LIST_KEY"
type="com.jcorporate.eforum.search.SearchResult" ... >
<purebean:write name="hit" property="subject" /> <br>
<purebean:write name="hit" property="body" /> <br>
</purelogic:iterate>
Also this approach may make easier to page through the hit list
as in the google.com web site.
--
Peter Pilgrim
ServerSide Java Specialist
My on-line resume and for interview videos about myself, J2EE
Open Source, Struts and Expresso.
||
\\===> `` http://www.xenonsoft.demon.co.uk/no-it-striker.html ''
More information about the Opensource
mailing list