You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Craig McClanahan <cr...@apache.org> on 2006/01/08 06:21:45 UTC

[SAF 2.0][Shale] Sharing action invocation between SAF and Shale

One of the things we talked about at the Struts BOF at ApacheCon was ways to
share technology between SAF and Shale.  Here's an opportunity to do that,
which I'd like some input on.

If you've been following my recent SVN commits, you've seen me working on a
remoting API for Shale[1] that includes a Processor abstraction to map an
incoming request for a "resource" to some sort of processing logic that
produces the corresponding response.  The basic interface (Processor) is
about as simple as it can get (given that this is already a JSF request, so
a FacesContext instance is available with access to the
request/response/context objects):

    public interface Processor {
        public void process(FacesContext context, String resourceId) throws
IOException;
    }

There are currently implementations for static resources (from either the
webapp or the webapp class loader), a way to bind to a JSF method binding
expression and trigger execution of an arbitrary method, and (just commited)
a way to invoke a Commons Chain command or chain that corresponds to the
resource identifier.  In the latter case, for example, it just creates a
simple Context object and passes it in to the command, expecting the command
to take responsibility for producing the corresponding response.

The same concept would seem equally applicabe to other sorts of scenarios
... in particular, invoking a Struts Action, or a XWork/WebWork action.  I
have a pretty good handle on how to implement the former ... it's that
latter that is not obvious at the moment.  Feasible implementations would
include:

* Write a processor that maps to an XWork action

* Write a processor that maps to a WebWork action

* Write a processor that maps to whatever a SAF 2.0 "action" thing ends up
looking like (which means waiting until we know that that is :-).

Thoughts on the best approach?

Craig

[1]
http://struts.apache.org/struts-shale/shale-core/apidocs/org/apache/shale/remoting/package-summary.html

Re: [SAF 2.0][Shale] Sharing action invocation between SAF and Shale

Posted by netsql <ne...@pointcast.com>.
     public interface Processor {
         public void process(FacesContext context,

This of course could just be process(Context  // like execute(Context
and then ANYTHING is compatible on the "action" side. I realy like the 
execute(Context) signature, I don't even do interfaces since everything 
to me uses that.

One way to look at compatible... is how can JSF "tags" call "WW2" 
"actions" via Shale. I'd think another way would be is how can Shale 
back struts HTML tag and JSTL and display tags. (Which could work now 
for all I know)
Like ... can I just take an Struts HTML taged jsp and have it backed by 
Shale "whatever".
Or restated, rather then having a plugable back end, it's just as 
interesting to have a plugable view to Shale (in my case RIA type, 
client processed UI request, rather than server pushed out).
I think that if Shale could have the plugable view... the less need for 
a brand new recode of WW2+Struts2 (since too many cooks ..., aka design 
by committee).
Restate #X: Ideally, if Shale can have plugable View (and "Action"), 
then WW2+Struts2 are just plug ins, or may ship w/ Shale.X , so Shale is 
JSF centric but could use other (like Struts "classic" could use Velocity).

.V




Craig McClanahan wrote:
> One of the things we talked about at the Struts BOF at ApacheCon was ways to
> share technology between SAF and Shale.  Here's an opportunity to do that,
> which I'd like some input on.
> 
> 


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