By: Lakshmi Emailed: 1705 times Printed: 2206 times
a. Add two fields named save and cancel to CustomerForm. Both fields are of type ImageButtonBean. Add getter methods for each.
b. Remove the step field and its getters and setters. We will not use it anymore.
c. Change the CustomerAction to use the following check in its execute() method, instead of the form.getStep().equals(“Save”):
This method checks if the save button is used for form submission.
d. Similarly the isCancelled() method will not work since the Struts supplied cancel button checks for pre defined request parameter. We now have to replace it with:
e. Also since we are not using the pre-defined Cancel button anymore, the validate() method in CustomerForm will run for Cancel too. Hence add the code to bypass validation for Form Cancellation.
f. In the CustomerForm.jsp, add the following for the image
g. Define the srcKey and altKey for both images in the Resource Bundles
image.save.alttext=Save the Form
Be the first one to add a comment
Most Viewed Articles (in Struts )
Most Emailed Articles (in Struts)