Return-Path: Delivered-To: apmail-incubator-ibatis-user-java-archive@www.apache.org Received: (qmail 3111 invoked from network); 13 May 2005 03:57:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 May 2005 03:57:00 -0000 Received: (qmail 58159 invoked by uid 500); 13 May 2005 04:01:11 -0000 Delivered-To: apmail-incubator-ibatis-user-java-archive@incubator.apache.org Received: (qmail 58137 invoked by uid 500); 13 May 2005 04:01:11 -0000 Mailing-List: contact ibatis-user-java-help@incubator.apache.org; run by ezmlm Precedence: bulk Reply-To: ibatis-user-java@incubator.apache.org List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list ibatis-user-java@incubator.apache.org Received: (qmail 58121 invoked by uid 99); 13 May 2005 04:01:11 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=HTML_30_40,HTML_MESSAGE,RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of clinton.begin@gmail.com designates 64.233.184.192 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.192) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 12 May 2005 21:01:11 -0700 Received: by wproxy.gmail.com with SMTP id 69so776072wra for ; Thu, 12 May 2005 20:56:55 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:references; b=D/zZIDmeJ8+SKUW8uQ5rwyd1lH6Zjpcav43mCc/QZBPqj4x+K9yPnBhSqY7CRXfdmup57avTHfW7aSRHp2VMvTo7B7DjerjbB8ILr9bbbuap4C8tLa3k5CwgOouqWarU9cQXhbM7DgMhBt3asAcQ+1Fs4rlu0hKciEho+czQkUw= Received: by 10.54.41.77 with SMTP id o77mr1517947wro; Thu, 12 May 2005 20:56:55 -0700 (PDT) Received: by 10.54.93.19 with HTTP; Thu, 12 May 2005 20:56:55 -0700 (PDT) Message-ID: <16178eb10505122056f358133@mail.gmail.com> Date: Thu, 12 May 2005 21:56:55 -0600 From: Clinton Begin Reply-To: cbegin@ibatis.com To: ibatis-user-java@incubator.apache.org Subject: Re: [OT] JPetStore - BaseBean / BeanAction In-Reply-To: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_8196_20266838.1115956615846" References: <2fe5ef5b0505121801c61857d@mail.gmail.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_8196_20266838.1115956615846 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline It should be noted that JPetStore also performs multiple "actions" per form= .=20 The difference is that with BeanAction, you must call a different URL for= =20 each "action". (I quote action, as there is obviously only one actual Actio= n=20 class...). Clinton On 5/12/05, Lieven De Keyzer wrote: >=20 >=20 >=20 > >From: Brandon Goodin > >Reply-To: Brandon Goodin > >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. >=20 > Yes, I should have given my real problem instead of this one. But that=20 > would > mean my action would be called: folderActions. And the methods foo and ba= r > would be: remove and edit. >=20 > >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.). >=20 > And I like this modern way better than the old one. :) >=20 > >Otherwise, it sounds like you have the idea down fairly well. > > > >Brandon > > > >On 5/12/05, Lieven De Keyzer 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 use= s=20 > ? > > > Something like: > > > > > > public Class TreeLevel extends BaseBean { > > > > > > private String method; > > > > > > public String formAction { > > > if (method =3D=3D "foo") { > > > return foo(); } > > > else { return bar(); } > > > } > > > > > > private String foo() { > > > // > > > } > > > > > > private String bar() { > > > } > > > } > > > > > > And then in my jsp page: > > > > > > > > > > > > > > > > > > > > > >=20 > ------=_Part_8196_20266838.1115956615846 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
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 - Ba= seBean / BeanAction
>Date: Thu, 12 May 2005 19:01:02 -0600
> >i'm not sure about your "formAction" semantic. You should nam= e it
>something meaningful like "removeFoo".  The= method names should be
>named after the actions that are taking plac= e.

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 us= e struts in a more modern
>manner (i.e. Action has properties on it r= ather than sepearate in an
>ActionForm.).

And I like this mode= rn 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 f= or 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 b= e able to check a few
>boxes
> > and let them choose to dele= te those, or edit them all at once, etc...
> >
> > Normal= l 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
> > simple= r. 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 =3D=3D "foo") {
> >        return foo(); = }
> >     else { return bar(); }
> > = }
> >
> >   private String foo() {
> >=      //
> > }
> >
> > &= nbsp; private String bar() {
> >   }
> > }
> >
> > And th= en in my jsp page:
> >
> >    <htm= l:form action=3D"/formAction">
> >   &= nbsp; <html:submit property=3D"method" value=3D"foo"= />
> >     <html:submit property=3D"meth= od" value=3D"bar" />
> >   </html:f= orm>
> >
> >


------=_Part_8196_20266838.1115956615846--