That is the difference between DispatchAction and LookupDispatchAction. Refer to:
http://jakarta.apache.org/struts/api/org/apache/struts/actions/LookupDispatchAction.html


Basically, in both cases you need to overload the getKeyMethodMap() method (Note: I think the documentation
I posted is wrong. I needed to declare it as public Map getKeyMethodMap() { }).


For DispatchAction, your Map will look like this:

map.put("Delete", "deleteMethod");

For LookupDispatchAction, you use a resource key instead of the submit button value.

map.put("globals.DELETE", "deleteMethod");

And as someone just posted, your submit button will look like:

<html:submit property="submitButton">
<bean:message key="globals.DELETE"/>
</html:submit>

- Josh

[EMAIL PROTECTED] wrote:

Alright, I think I basically understand how this works, but doesn't this
interfere with internationalization?
If we want to use a message from Application Resources for the button label,
and if we check for that value in our action, won't the internationalization
get completely messed up?

- Keith

www.buffalo.edu/~kkamholz


-----Original Message----- From: Josh McCulloch [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 1:39 PM To: Struts Users Mailing List Subject: Re: Submit Value


A submit button is supposed to submit a parameter when selected. i.e.

<input type="submit" name="submitButton" value="Delete">

should send /xxx.do?submitButton=Delete

This should correspond to a member of your ActionForm.

You should also look into DispatchAction and LookupDispatchAction.
They can call different "execute" methods depending on a parameter from the form post.


HTH,
Josh


[EMAIL PROTECTED] wrote:




Ok... Does anyone have a good alternative then?



-----Original Message-----
From: Phillip Qin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 1:14 PM
To: 'Struts Users Mailing List'
Subject: RE: Submit Value


Don't bother trying it. Only Mozilla gives you the value, while IE doesn't.


-----Original Message-----
From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED] Sent: May 28, 2003 1:01 PM
To: '[EMAIL PROTECTED]'
Subject: Submit Value


Quick question...

I'm using 2 submit buttons in the same form, so that I can do 1 of 2


things,


with the same input data.
(You can do that, right?)
I have the value attribute for one of them set to 'delete'. What I'm
wondering is how to get the value of the submit button that was clicked


from


within the action class.

Thanx a million.

- Keith

www.buffalo.edu/~kkamholz


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]









--
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with [EMAIL PROTECTED] http://shopnow.netscape.com/




Reply via email to