Hi all,

      In my JSP, i have three submit buttons, i want to know which button
user has clicked.

 I tried from this site, 
http://struts.apache.org/2.x/docs/html-form-buttons-howto.html 
http://struts.apache.org/2.x/docs/html-form-buttons-howto.html  
It's not working. 

            Give me some ideas,  i have added my code,


      public String execute() {
        if (buttonOnePressed) {
            message = "You pressed the first button";
           Save();
         
        } else if (buttonTwoPressed) {
            Update();
            message = "You pressed the second button";
        } 

        else if (buttonThreePressed) {
           Show();
            message = "You pressed the second button";
        } 
        else {
            return ERROR;
        }
        return SUCCESS;
    }

 In My Struts.xml file,

<action name="user_details2" class="com.user_details">
            <result  name="input">/JSP/user_details.jsp</result>  
                        <result name="success">/JSP/user_details.jsp</result>
                        <result name="error">/JSP/user_details.jsp</result>
                        
                </action>

In Jsp,

 <input type="submit" name="buttonOnePressed" value="Save"/> 
<input type="submit" name="buttonTwoPressed" value="Update"/> 
<input type="submit" name="buttonThreePressed" value="Show"/> 
-- 
View this message in context: 
http://www.nabble.com/Multiple-submit-buttons-in-a-single-JSP-tp15334087p15334087.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to