You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ChenJP <ch...@email.com> on 2000/09/27 07:46:24 UTC

Struts and Cocoon

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.




Re: Struts and Cocoon

Posted by Michael Bierenfeld <mi...@atmiralis.de>.
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" <mi...@atmiralis.de>
> To: <co...@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

Re: Struts and Cocoon

Posted by ChenJP <ch...@email.com>.
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" <mi...@atmiralis.de>
To: <co...@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
> 

Re: Struts and Cocoon

Posted by Michael Bierenfeld <mi...@atmiralis.de>.
> 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