ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: [OT] JPetStore - BaseBean / BeanAction
Date Fri, 13 May 2005 03:56:55 GMT
It should be noted that JPetStore also performs multiple "actions" per form. 
The difference is that with BeanAction, you must call a different URL for 
each "action". (I quote action, as there is obviously only one actual Action 
class...).

Clinton


On 5/12/05, Lieven De Keyzer <lieven_dekeyzer@hotmail.com> wrote:
> 
> 
> 
> >From: Brandon Goodin <brandon.goodin@gmail.com>
> >Reply-To: Brandon Goodin <brandon.goodin@gmail.com>
> >To: ibatis-user-java@incubator.apache.org
> >Subject: Re: [OT] JPetStore - BaseBean / BeanAction
> >Date: Thu, 12 May 2005 19:01:02 -0600
> >
> >i'm not sure about your "formAction" semantic. You should name it
> >something meaningful like "removeFoo". The method names should be
> >named after the actions that are taking place.
> 
> Yes, I should have given my real problem instead of this one. But that 
> would
> mean my action would be called: folderActions. And the methods foo and bar
> would be: remove and edit.
> 
> >But, yes you would follow the same semantic. You need to realize that
> >JPetstore is NOT
> >standard struts practice. It is a way to use struts in a more modern
> >manner (i.e. Action has properties on it rather than sepearate in an
> >ActionForm.).
> 
> And I like this modern way better than the old one. :)
> 
> >Otherwise, it sounds like you have the idea down fairly well.
> >
> >Brandon
> >
> >On 5/12/05, Lieven De Keyzer <lieven_dekeyzer@hotmail.com> wrote:
> > > I took the lastest JPetStore as a starting point for my application.
> > >
> > > The problem I have now: I want to have multiple actions in one form. I
> >have
> > > a set of objects belonging to a user and this are displayed together
> >with a
> > > checkbox for each object. I want the users to be able to check a few
> >boxes
> > > and let them choose to delete those, or edit them all at once, etc...
> > >
> > > Normall I think one should implement a class that inherits from the
> > > DispatchAction Class.
> > >
> > > I guess using the BaseBean and BeanAction class, this should even be
> > > simpler. Should I use the same tactic as the DispatchAction class uses 
> ?
> > > Something like:
> > >
> > > public Class TreeLevel extends BaseBean {
> > >
> > > private String method;
> > >
> > > public String formAction {
> > > if (method == "foo") {
> > > return foo(); }
> > > else { return bar(); }
> > > }
> > >
> > > private String foo() {
> > > //
> > > }
> > >
> > > private String bar() {
> > > }
> > > }
> > >
> > > And then in my jsp page:
> > >
> > > <html:form action="/formAction">
> > > <html:submit property="method" value="foo" />
> > > <html:submit property="method" value="bar" />
> > > </html:form>
> > >
> > >
> 
>

Mime
View raw message