struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Heligon Sandra <sandra.heli...@nextream.fr>
Subject RE: Multiple submit buttons
Date Tue, 17 Dec 2002 09:10:51 GMT
What is the best solution: extends the MyLokkupDispatchAction from the
LookDispatchAction or from my BaseAction class ?
I think that it is better to extends from LookDispatchAction and copy the
code of the BaseAction in the MyLokkupDispatchAction class because we
know the code the changes applied.
Any of these two solutions are satisfactory, there is no other alternative ?

Sandra 

-----Original Message-----
From: Arnaud HERITIER [mailto:aheritier@sopragroup.com]
Sent: 17 December 2002 09:41
To: 'Struts Users Mailing List'
Subject: RE: Multiple submit buttons


You're not in C++ :-)
In java you can't inherit from several classes.
(cf java specs)

Arnaud.


> -----Message d'origine-----
> De : Heligon Sandra [mailto:sandra.heligon@nextream.fr]
> Envoyé : lundi 16 décembre 2002 17:58
> À : 'Struts Users Mailing List'
> Objet : RE: Multiple submit buttons
>
>
> all the actions of my application extends a BaseAction class.
> It is possible that the DefaultLookupAction extends from two
> classes, isn't it ?
> I tried to do that with RationalRose but I have an error message
> but I think that it this problem is specific to RationalRose
> unless that is
> not recommended
> in object's modelisation(UML)?
>
> -----Original Message-----
> From: Scott Reisdorf [mailto:reisdorf1@llnl.gov]
> Sent: 16 December 2002 17:46
> To: Struts Users Mailing List
> Subject: Re: Multiple submit buttons
>
>
> You are right....use the LookDispatchAction
> you just need something like the followingm, where the
> mapping parameters
> represent the .properties file attributes.
>
> your jsp will look like the following:
>
> html:submit property="action">
> bean:message key="button.lookupAmazonAuthor"/>
> </html:submit>
>
> html:submit property="action">
> bean:message key="button.lookupAmazonKeyword"/>
> </html:submit>
>
> Your Java Class will look like the following:
>
> public class BookLookupDispatchAction extends LookupDispatchAction {
>
>
>    protected Map getKeyMethodMap() {
>      Map map = new HashMap();
>      map.put("button.lookupAmazonAsin", "lookupAmazonBookByAsin" );
>      map.put("button.lookupAmazonKeyword",
> "lookupAmazonBookByKeyword" );
>      map.put("button.lookupAmazonAuthor","lookupAmazonBookByAuthor");
>      return map;
>    }
>
>    public ActionForward lookupAmazonBookByAsin(ActionMapping mapping,
>                              ActionForm form,
>                              HttpServletRequest request,
>                              HttpServletResponse response)
>      throws Exception {
>        ...
>          }
>
>   public ActionForward
> lookupAmazonBookByKeyword(ActionMapping mapping,
>                              ActionForm form,
>                              HttpServletRequest request,
>                              HttpServletResponse response)
>      throws Exception {
>
>           ....
>
>
>
> etc...
>
> Hope this helps.
>
>
> At 05:34 PM 12/16/2002 +0100, you wrote:
>
> >         I know that this topic with already evoked in the preceding
> >messages, but I have evil to make a synthesis.
> >         When a form has several buttons submit (save,
> update, delete,
> >cancel, create ...) to perform the action, but
> >         what it is the best method?
> >         1) <input type = "submit" name= "update_submit"
> value="<bean:message
> >
> >         in the action class
> >         if (pRequest.getParameter("update_submit")!=null){
> >         }else ...
> >         2) use the LookDispatchAction
> >(http://www.husted.com/struts/tips/003.html)
> >         3) JavaScript with hidden field
> >         I tend to think that the best method is the second
> is really the
> >case?
> >         To use  LookDispatchAction I must create a subclass
> that extends
> >LookDispatchAction, isn't it ?
> >         Are there disadvantages to use LookDispatchAction ?
> >
> >
> >
> >
> >
> >
> >
> >
> >--
> >To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:struts-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message