struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Aggarwal" <>
Subject Multiple submit buttons on form not working
Date Thu, 01 Mar 2007 04:48:46 GMT

I am trying to follow this guide:

To create a multiple button form.  Unfortuntely, it is not
working for me.

I created a simple demo page at:
As you can see, press any button but the boolean states do
not change.

Here is my action class:

package test;

import com.opensymphony.xwork2.*;

public class FormTest extends ActionSupport {
  private String message;
  private boolean message1;
  private boolean message2;
  public String execute() throws Exception {
    message = "States m1: "+message1+" m2: "+message2;
    return INPUT;

  public String getMessage() {
    return message;

  public void setMessage(String message) {
    this.message = message;

  public boolean isMessage1() {
    return message1;

  public void setMessage1(boolean message1) {
    this.message1 = message1;

  public boolean isMessage2() {
    return message2;

  public void setMessage2(boolean message2) {
    this.message2 = message2;

Here is the jsp source:

<%@ taglib prefix="s" uri="/struts-tags" %>

<h1>Form test</h1>

<s:form action="test/FormTest">
	<s:property value="message"/>
  <s:submit value="First Message" name="message1" />
  <input type="submit" name="message1" value="Direct button"> 
  <s:submit value="Second Message" name="message2" />

Any ideas why this is not working?


Neil Aggarwal, (214)986-3533,
FREE! Eliminate junk email and reclaim your inbox.
Visit for details.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message