John wrote:

> I have a form that can be submitted by three different buttons, for example
> the buttons read
> 
> (Button Labels)
> Process
> View by Org
> View by Product
> 
> So, how can I figure out what button was pressed in that Action class? Is
> there a way to do that?

I'm not sure if this is struts-kosher, but it works. I have a form that 
includes two buttons:

<html:submit property="submit" value="Submit" />
<html:submit property="submit" value="Forgot Password"/>

Then I added get/set methods for a "submit" property in the associated 
FormBean. The Action class can then determine which button was pressed 
by calling getSubmit and doing a string compare:

String submit = myform.getSubmit();
if ( submit.equals ( "Forgot Password" ) )
{
   // etc...
}

Joel

-- 
-------------------------------------------------
             Descriptor Systems
   Java, C++ and XML Training and Courseware
             www.descriptor.com
             ICQ: 150414760
-------------------------------------------------


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

Reply via email to