I have an action for updating an address object: ChangeAddressAction which has 2 methods: show() and update(). This action implements prepare() and getModel(). I have the following validation file -> ChangeAddressAction-update-validation.xml in my action package (along with other validations).
ChangeAddressAction (extends ActionSupport) implements Preparable, ModelDriven<Address>
prepare() - sets up an action attribute
getModel() - returns the address object
show() - populates the action's address object - renders the
jsp to the user
update() - expects a VALID populated address object to send to the service
I call an action mapping to render the changeAddress.jsp which calls the ChangeAddressAction show() method. The JSP renders with all of the pre-populated address information. However when I submit (to a different action mapping calling the same action with the update() method), the validations on the action are not performed.
<action name="ShowAddress" class="com.ChangeAddressAction" method="show">
<result>changeAddress.jsp</result>
</action>
<action name="ChangeAddress class="com.ChangeAddressAction" method="update">
<result name="input">changeAddress.jsp</result>
<result name="success">changeAddress.jsp</result>
</action>
From the documentation that I've seen so far I thought it would be enough to name the validation file the same as the ChangeAddressAction-update-validation.xml for validations to be triggered, but they aren't triggered.
I have several other validation files that do not have aliases which trigger as expected. What am I doing wrong?!
Thanks