struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hezjing <hezj...@gmail.com>
Subject [S2] Multiple buttons in a form
Date Mon, 04 Feb 2008 06:04:24 GMT
Hi

I have a form with multiple buttons,

<s:form namespace="/user" action="updateUser" method="post">
   <s:submit name="action" value="resetPassword" key="button.resetPassword" />
   <s:submit name="action" value="delete" key="button.delete" />
</s:form>


and my action class looks like the following,

public String execute() throws Exception {
    if (action.equals("resetPassword")) {
        userService.resetPassword(user);
    } else if (action.equals("delete")) {
        userService.delete(user);
    }
    return SUCCESS;
}


This action is working, except that the label/text of the buttons are
not fetched from the i18n properties file.

The buttons are displayed as "resetPassword" and "delete".

What is the good way to implement a form with multiple buttons, while
maintaining the i18n?


-- 

Hez

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message