Jason Dolinger wrote:
Hi all,

I'm new to Struts 2 (and Struts in general), and I'm having a hard time 
figuring out how to handle the simple case of multiple buttons within a form.  
The method I'm trying to use is described in the Struts 2 cookbook here:  
http://struts.apache.org/2.x/docs/html-form-buttons-howto.html.

I've copied these verbatim (along with a small struts.xml to wire them up), and both button boolean fields always remain false. Should this work? I'm using Struts 2.0.11. There's always the route of using Javascript to detect which button was clicked, but I'd rather avoid it if not necessary.


Are you sure you copied the example code faithfully? It should work as advertised. Post your action mapping configuration and the action code/JSP markup you're actually using; maybe there's a simple mistake in there someone can spot.

I've also seen mention of a Struts LookupDispatcher or MapDispatcher. Is there something similar in Struts 2?

There are no direct equivalents of those classes in Struts2 because they aren't needed. The Struts2 core includes mechanisms that allow you to achieve the same things more directly. See, for example, the 'method' attribute on action mappings and on the s:form and s:submit tags.

L.


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

Reply via email to