Question

<form-bean name="RegisterForm" type="com.mysite.form.RegisterForm" />

<action path="/register" type="com.mysite.action.RegisterAction" name="RegisterForm" input="/register.jsp" validate="true">
                <forward name="success" path="/welcome.jsp" />
                <forward name="failure" path="/register.jsp" />
            </action>

RegisterForm

public class RegisterForm extends ActionForm{
private String name;

    /**
    Constructor
    Set+Get
    **/

    public ActionErrors validate(ActionMapping mapping, ServletRequest request) {

        ActionErrors errorList = new ActionErrors();
        System.out.println("VALIDATING");
        return errorList;
    }
}

This is all i have. For some reason it seems that the control flow jumps directly to the ActionForm's execute method because I can't even see the VALIDATING message in the console. Is there something I'm missing? Thanks!

Was it helpful?

Solution

You need to use the other overloaded validate() method that takes HttpServletRequest

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top