cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Hohls" <>
Subject RE: new to cocoon question
Date Fri, 12 Mar 2004 06:25:39 GMT
In reply to:  (some previous detail omitted)

>>> 2004/03/11 10:13:17 PM >>>

>Hmm, again being a cocoon newbie, I thought XSPs with cocoon were like
>when used with struts.  Hence they are more for "presentation"--or in
>sense "view"--rather than the controller/model aspect in struts
actions.  If 
>so, I don't think XSPs are appropriate for handling controller-like
>Correct me if I'm wrong about the whole XSP thing.

Well, I guess it depends on how you define your terms - I am not too
hung up on MVC, and I am not sure that bending the universe to fit
into that "view" (for want of a better term!) is necessarily a Good
That being said, XSP was primarily designed to be able be generate
where the generation procedure depends on some logic.  The logic can
be encapsulated into reusable logic sheets (really, fragments of Java
or embedded into the source XSP.  I would not use them for viewing
per se.  So no, I would not compare them to JSP in Struts (bearing in
that it is a *long* time since I have used JSP; looking back now it
seems a 
very clunky mishmash approach...) - but you are right that XSP are not
doing overall application "control"  - that is the role of the sitemap
control flow.

>I skimmed through this and still can't quite see how this type of 
>control/logic flow fits in the perspective of 1) take requests, 2)
grab info 
>from form, 3) call appropriate java business logic and process any
>information, 4) forward to page with processed information.  

What can I say?  its there, as I said, in conjunction with the

>My first  problem with cocoon control logic is that it seems to rely
on a 
>JavaScript-like language.   

Not sure why this is a problem per se? 

>Can this type of scripting language invoke Java 
>business logic directly?  


>Personally I would like the controller to be in 
>Java since it will have to invoke java-based logic regardless.  

Well, a language is just a language - heck, you could write your
webapp in pure java and stop messing around with all these higher level

abstractions that "hide" the Real Code, if you are that way inclined!

> Secondly, seems to me this control flow mechanism is really just a
> system based on the state of the system.  No controller-like
functionality here. If 
>this is the case, then cocoon control flow is just like declaring
global/local action 
> forwards in the struts-config.

Hmm, as I said right at the start I am not familiar with Struts and
cannot compare
aspects directly - what additional "controller-like functionality" do
you need that cannot
be embedded in customized Java actions (that you could write) and
called from
Cocoon?  Analogies can be helpful, but can also limit to your view to

> Another question that I have regarding the previous post was that
> actions could not call the business layer directly?  I thought that
> actions were able to do that.  For example, suppose a form gets
submitted by 
> a user.  Cocoon picks this up and forwards it to a particular cocoon
 >  This action grabs the form parameters via woody, calls a service
> by the business tier (passing any required parameters supplied in the
> processes any result returned by this service, and packages the final
> via a Map to be returned to the user.   Now my question is, can this

> particular scenario be done with a cocoon action?  

AFAIK, yes - but you will have to ask more experienced heads than mine
about this one!

> Any suggestions would be appreciated.  Thanks again!

Keep reading and asking - maybe browse the mail archives and ask
more specific questions in particular threads.  People will probably
"it can be done" but are unlikely to want to write code for you unless

they can see you are attempting something first yourself... 


> >>> 03/11/04 8:38 PM >>>
>Well, in essence, struts actions do return a "forward".  However, the
>page/action to forward to is agnostic in practice, i.e. the actual
>action to forward next is defined separately in a config file called
>struts-config.xml (I think this is similar to the sitemap).  So
>configuration where struts  does its forwarding is outside of the
>In theory, the struts actions are extensions of the controller (or
>depending on how you interpret it) in the MVC paradigm.  They can
>the actual business logic, but in practice they are used as
>delegates--calling business objects to do the work.  Hence struts
>are like a service layer for the front-end, interacting with the
>layer.   Looking at cocoon actions, they return a Map containing
>used for display purposes.  This can be done in struts actions by
>putting the information into the request (usually encapsulated as a
>that can be easily manipulated with struts or jstl tags.
>Therefore my understanding thus far about cocoon when comparing it to
>is that the cocoon actions are "similar" to struts actions.  Do you
>cocoon actions more often then the *traditional* pipeline for doing
>applications?  I really don't see anywhere else in the cocoon
>where there is an explicit class that handles requests, calls
>the business layer and returns a response.  Everything else in cocoon
>to be all transformations of some sort.
>Also, struts has a neat thing with declaring forms.  There is the
>traditional way of creating POJOs via ActionForms and there is the
>declarative way defined in the struts-config called DynaForms.  In
>cocoon, I
>see something called "woody" and "xforms".  I have no clue how these
>are used within the cocoon framework, particular with cocoon actions.
>struts, the form used for submission is explicitly passed to the
>handling the form.  In cocoon actions, I don't see any woody form
>passed in...
>Any more suggestions would be appreciated!  Thanks!
> >From: Ralph Goers <>
> >Reply-To: 
> >To: "''" <>
> >Subject: RE: new to cocoon question
> >Date: Thu, 11 Mar 2004 09:11:31 -0800
> >
> >Pardon my ignorance on Struts as I haven't used it extensively
> >my recollection is that Struts invokes Actions which then return a
> >-
> >in essence telling the controller what to do next based upon what
> >business logic for the action did.  This, in essence and IMO, makes
> >Action more knowledgeable than it should be.
> >
> >Cocoon's notion of an action is somewhat different, although it can
> >subverted to behave very similarly to a Struts action.  Typically
> >in
> >Cocoon simply return information in a Map object.  The pipeline is
> >configured to operate upon that data in any manner it sees fit. 
> >action is in the business of simply returning information rather
> >acting
> >as a director.
> >
> >Ralph
> >
> >  -----Original Message-----
> >From: 	Derek Hohls [] 
> >Sent:	Thursday, March 11, 2004 8:57 AM
> >To: 
> >Subject:	Re: new to cocoon question
> >
> >Interesting question - in brief, actions are primarily used
> >pipelines to act as logic "switches" between different choices; or
> >allow easy handling of case failures. I am not sure how this
> >to what Struts does - I actually would like to find out more about
> >Struts
> >as there a number of developers I know that use it, to whom I'd like
> >relate a little better - if there is any reading you can point me
> >towards
> >to grasp that framework's approaches, I'd be happy to share any
> >comparisons I find (as this is something I want to do anyway...)
> >
> >Derek
> >
> >D Hohls
> >Environmental Systems Developer
> >CSIR Environmentek
> >PO Box 17001
> >Kwa-Zulu Natal
> >South Africa
> >4013
> > 
> >
> >
> >
> >To unsubscribe, e-mail: 
> >For additional commands, e-mail: 
> >
>Frustrated with dial-up? Lightning-fast Internet access for as low as

>To unsubscribe, e-mail: 
>For additional commands, e-mail: 
>This message has been scanned for viruses and
>dangerous content by MailScanner, and is
>believed to be clean.
>MailScanner thanks transtec Computers for their support.
>To unsubscribe, e-mail: 
>For additional commands, e-mail: 

Get a FREE online computer virus scan from McAfee when you click here. 

To unsubscribe, e-mail: 
For additional commands, e-mail: 

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message