You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ryan Olson <rd...@financialcontent.com> on 2002/12/03 00:25:26 UTC

Bypassing validation in ActionForm for certain LookupDispatchAction modes

Hi,

I have a LookupDispatchAction which performs add, update, and delete 
operations based on an incoming ActionForm. I have a validate() method in the 
ActionForm since I need to validate input for the update and add operations, 
but I want to bypass that method in the case of the delete action (ie I don't 
want the user to be stopped from deleting a record that they may have made 
changes to and doesn't presently contain valid data).

Based on the list archives it looks like the way to do this is to add a check 
to the validate() method, like this:

String dispatchParam = mapping.getParameter();
String dispatchActionMode = request.getParameter(dispatchParam);

Since I'm using LookupDispatchAction I want to compare the value of 
dispatchActionMode with the button label as defined in my 
ApplicationResources properties file ("button.label.delete") in this case. 
However, I haven't been able to figure out how to get at that value from 
within my ActionForm. (Actually, I'd rather look up the value in the Map 
returned by getKeyMethodMap() in the LookupDispatchAction, but it's neither 
public nor static.) 

I'm also open to other suggestions as to how to go about doing this.

Thanks

Ryan Olson


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>