You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mark Leonard <ma...@blueroads.com> on 2002/11/14 00:56:38 UTC

1.1b2 - validate() form method gives blank screen when errors present

Greetings,

I am having a problem where a blank screen is presented instead of redirecting the user back to the "input" attribute if the validate() method returns errors.  If validate() finds no errors or if i set validate="false" for the action, processing is ok with successful redirection to the success page defined in my mapping.  The configuration for the action is shown below.

I have set up the "TestForm" to always add an error during my testing and the println shows that errors.size() is 1 on the console.  I am using tomcat 4.1.12 and there are no error messages appearing in the log files.

"error.dummy.testing" is defined in my properties file and errors are successfully displayed on another page in my app when the ActionErrors are set and saveErrors(...) is called in my Action subclass.

I'd appreciate any ideas as to what is going wrong with my configuration before i start nosing through the struts source code.

Thanks,

-Mark

TestForm snippet

    public ActionErrors validate(ActionMapping mapping,
                                 HttpServletRequest request) {

	ActionErrors errors = new ActionErrors();
	errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("error.dummy.testing"));
	System.out.println("actionerrors size, " + errors.size());
        
	return errors;

    }

-----------------------------------------------------------------------------
struts-config.xml snippet

	<form-bean		name="testForm"
					type="strutstest.TestForm"/>

    <action
       path="/addProfileEntry"
       forward="/WEB-INF/jsp/addProfile.jsp">
    </action>

    <action	path="/addProfile"
            type="strutstest.TestAction"
            name="testForm"
            scope="request"
            input="/WEB-INF/jsp/addProfile.jsp"
            validate="true">
      <forward name="success"    path="/WEB-INF/jsp/addProfileConfirmation.jsp"/>
    </action>

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