Hi,
i have JSP page as below.
ControllerCode:<form:form commandName="user" methd="POST"> <form:input path="name" /> <input type="submit" name="btnSave" value="Save"/> <input type="submit" name="btnCancel" value="Cancel"/> </form:form>
When i enter name and click "Save" button. "name" property of "User" bean is saved. But when i press "Cancel" button it shows same behavior and set "name" property with changes made.Code:public string saveForm(@ModelAttribute User user,Model map) { System.out.println("Name = "+user.getName()); return "UserForm"; }
But as per my requirement "Cancel" button should not set properties and it just redirects to the mentioned page.
Please help.


Reply With Quote
