You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Brandon Goodin <ma...@phase.ws> on 2003/01/23 20:15:18 UTC

Validator and Exposing the LookupDispatch method name

Greetings,

I am setting up Validator to be used within my Action class.

I am using LookupDispatchAction. Due to the nature of the dispatch action I
may want to validate a particular form different depending on the method
being called. For example, I have a quit method that is activated when
someone clicks the "Quit" button in a form. In this case I want no
validation to happen. But, when the user clicks the "Edit" button and the
edit method is called I want the validation to occur. I have come up with a
temporary way of handling this by supplying a hardcoded key straight to my
validate method. But, the ideal process would be to expose the method name
that is being called as a result of the dispatch parameter and set that as
part of the key that I will be using as the form element's name attribute in
the validation.xml file (i.e. name="/myAction.do.edit <- edit being the name
of the method being called in the myAction.do mapped class). This would
allow me to perform my validation properly and in the right methods.

Is there any chance that we can make a tweak that would expose that method
value to the LookupDispatchAction outside of the super.execute method.
Currently the execute method does the lookup on the method name internally.
There is now way to find out the method being called outside of the scope of
the execute method. It would be nice if the Lookup process was exposed
outside of the execute method. Perhaps the lookup process could be extracted
into it's own method which can do the lookup from anywhere in the action. In
that case the execute method could make a call to see what method was called
as well as other places in the code could. This would be nice for other
potential configuration conveniences, none of which I can think of now ;-)).
Anyways, have a good one.

Thanks,
Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
mail@phase.ws
http://www.phase.ws



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