An action's validation will fire unless an action method specifically excluded by the validation interceptor, the validation file is for a specific action class/method alias, or a couple other things not relevant in your case.
There are a few ways around this, the simplest being to run the "input" method on first hitting the page; this can be done in a few ways, like dynamic method invocation, wildcard action mapping, etc. <action name="foo_*" class="full.action.class" method="{1}"> .... (or method="do{1}" if you want to exclude other public methods from the possibility of being executed; there was a somewhat lengthy thread about this earlier this week/last week.) Hitting /foo_input.action will run the "input" method, which is excluded from validation by default. Another way would be to have two action mappings for the same class, more or less like this: <action name="foo" class="full.action.class" method="input"> .... <action name="bar" class="full.action.class" method="execute"> ... className-bar-validation.xml The S2 documentation wiki covers these options (and probably a few more) and there are a few WebWork validation articles out there as well, I believe they're linked to on the wiki. d. --- Shoaib Gauhar <[EMAIL PROTECTED]> wrote: > Hello, > > I am new to struts 2 validation architecture. I am > facing a problem which might be very simple. I am > adding all of my validation rules in the > actionclass-validation.xml. It works fine. But what > happens is that when the JSP page opens for the > first time, it validates the fields and shows all > the error messages (ideally it should not validate > the fields, because the first time the page loads, > all the fields are empty). So, what i want is not to > validate when the page opens for the first time and > after that it should. > > I hope you guys understand my query. > > Shoaib Ahmad > > > > ____________________________________________________________________________________ > Never miss a thing. Make Yahoo your home page. > http://www.yahoo.com/r/hs > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]