Gundersen, Richard wrote:
Hi

When validation succeeds on my form, I still get returned to the input
page. My execute() method does not seem to be getting called even when
validation is OK.
This is my Action  (no @Validation annotation after I read that was
deprecated)

=======================================================
    @Validations(visitorFields = {
        @VisitorFieldValidator(message = "Default message",
        fieldName = "surname",
        appendPrefix = false)
    })
    public String execute() {
        ...


    @RequiredStringValidator(message="Validation error",
key="validate.surname")
    public String getSurname() {
        return surname;
    }
        ...
=======================================================

Do you have a setSurname(String) method? Without it, Struts can't pass the input data into your action.

This is my struts.xml snippet, with the correct result attributes
        <action name="login" method="execute" class="loginAction">
            <result name="success" type="tiles">home</result>
            <result name="input" type="tiles">welcome</result>
</action>
In the logs, when I enter an empty surname, I see "surname is invalid"
when I expect. The same message is not in the logs when I enter a valid
value, so I would expect it to then drop into my 'execute' method. But
it doesn't, it just returns to the 'input' page...

Any ideas?

If you do have the setter in your action and you're getting this, do you have any action errors/messages showing up when you get returned to the input page?

L.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to