cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Bierenfeld <michael.bierenf...@atmiralis.de>
Subject Re: Struts and Cocoon
Date Wed, 27 Sep 2000 07:34:47 GMT
ChenJP wrote:
> 
> Thanks for your response.
> 
> So , is there any sample of mapping Form Post parameter into a JavaBean by JSP ?
> 
> Really thanks a lot.
> 
> ----- Original Message -----
> From: "Michael Bierenfeld" <michael.bierenfeld@atmiralis.de>
> To: <cocoon-users@xml.apache.org>
> Sent: Wednesday, September 27, 2000 3:19 PM
> Subject: Re: Struts and Cocoon
> 
> > > ChenJP wrote:
> > >
> > > I am really new to Cocoon.
> > >
> > > I am using Struts now.
> > > And its MVC design is very good for me,
> > > especially can mapping all form post data into
> > > Java Bean. But its view layer is very
> > > time-consuming . I have to replace all related
> > > FORM HTML tag to Structs TAG.
> > >
> > > Now I want move to Cocoon, But I still want to
> > > use Strust-like Form Processing function.
> > >
> > > So one questiong:
> > > Does Cocoon has Struts-like Form Processing
> > > function, which can map HTML Form Post data into
> > > JavaBean?
> > >
> > > Any suggestion and examples is appreciated .
> > >
> > > Really thanks a lot.
> > >
> > > ChenJP.
> > >
> > >
> > >
> >
> >
> > Sorry,
> >
> > but what is strut. Maybe the processing is fairly
> > similar. The processing from a Form into a
> > JavaBean from XSP is fairly simple.
> >
> > Regards
> >
> > Michael
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: cocoon-users-help@xml.apache.org
> >

This is of course dependig on the JavaBean. Eg
Database Table 

customer
--------

*nCustomerId
-sCustomerName
-sCustomerDesc

The Bean generator creates a Class Customer with
the following "BaseFunctions"

Object getByName (String columnName)
boolean setByName (String columnName, String
Value)
boolean insert ()
boolean update ()
boolean retrieve ()

and so on.

Form with the following Input Elements
--------------------------------------

<FORM name=MyBeans.Customer>
	<INPUT name=nCustomerId/>
	<INPUT name=sCustomerName/>
	<INPUT name=sCustomerDesc/>
</FORM>

The form is submitted to an xsp-page. This reads
out all request-Parameters and stores them in a
Hashtable.

The Class Customer has a Function getByHashTable.
And voila the data is in the Bean. With a little
efford you can do this generally. So all you have
to do is to design a TableStructure and generate
the xml-content.

Good Luck

Michael

Mime
View raw message