cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <j...@socialchange.net.au>
Subject MVC, Struts and Cocoon (was: We need a forms taglib)
Date Sat, 21 Oct 2000 02:38:59 GMT
On Fri, 20 Oct 2000, Ulrich Mayring wrote:

> Hello,
> 
> some time ago various people professed to be working on a forms taglib.
> Are any of these projects finished? If not, perhaps you can send me your
> code and I'll try to incorporate into my bits'n'pieces.
> 
> I think we need a forms taglib now, anyway I need it and have decided to
> spend a little time on this. I do know about the fp:if-post and
> fp:if-get in the fp taglib and will try to incorporate them, but I think
> there was more.

What sort of functionality are you looking for?

My question is really: are you interested in forms as a navigational
device, or as a data collection device?

By navigational, I mean using forms to control where the user visits
next. By data collection, I mean simple "enter your name, age, ..." type
forms.


If you're using forms for navigational purposes, then the Jakarta Struts
project may interest you. Struts implements an Model-View-Controller
framework (http://jakarta.apache.org/struts/users_guide.html). Now before
everyone disregards Struts on the basis of it's association with JSP
("eeww!"), and starts preaching the SoC purity of Cocoon, let me say:

********
The core of Struts that implements the MVC pattern is *independent* of JSP.
********

The JSP form taglib that Struts provides is just one way to talk to the
Struts core MVC engine. To quote Craig McClanahan, the designer:

>> In general, the MVC framework part of Struts 
>> can clearly be used by itself, even if you do
>> not use the form based tags (or even if you 
>> use something besides JSP to render the user 
>> interface.
 -- (http://marc.theaimsgroup.com/?l=struts-user&m=86951931906104&w=2)

So we could probably create a Cocoon navigational-form taglib that does
exactly what the JSP taglib does, ie talk to the Struts MVC core.


For "data collection"-type forms, there is possibility for creating a
taglib to automatically populate a bean with form data, ala <jsp:useBean>
tags. Struts has this too, I think. A Cocoon version would be very nice..

<xsp:page>
	<form:populateBean name="foo">
		<form:setProperty name="attr1" property="propertyattr"/>
	</form>
</xsp:page>

<xsp:page>
	<form:populateBean name="foo">
		<form:setProperty name="*"/> <!-- populates any bean
attributes which have corresponding set request parameters -->
	</form>
</xsp:page>


IMHO, Cocoon is great for single complex pipelines, but provides nothing
for website structure and navigation. For that, current opinion seems to
favour the Model-View-Controller pattern, which Struts provides.

Has anyone out there been using Struts and Cocoon together?

--Jeff

(DISCLAIMER: I have used Struts only minimally. I hope I haven't
misrepresented anything)

> 
> Ulrich
> 
> -- 
> Ulrich Mayring
> DENIC eG, Systementwicklung
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 



Mime
View raw message