Hello,

I've made myself a small test application. I wanted to test error handling
within the "validate" method. The problem is that I'm not being redirected
to the jsp I have specified inside the "input" attribute. Instead, I'm
getting a blank page (with no error messages at all inside).

This is the validate method in my form:

public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest
httpServletRequest) {
    ActionErrors errors = new ActionErrors();
    if ((this.getName() == null) ||
        this.getName().trim().equals("")) {
      errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("Must specify a
name"));
    }
    if (errors.isEmpty()) {
      return null;
    } else {
      return errors;
    }
}

This is the <action> mapping inside my struts-config.xml:

<action input="admin_customers.jsp" name="customerForm"
path="/createCustomer" scope="request"
type="com.xxxxx.sgp.presentation.struts.invoice.CreateCustomerAction"
validate="true">

        <forward name="unexpected_error" path="/unexpected_error.jsp"
redirect="true" />

</action>

I'm not using the <message-resources> tag (I believe it's not mandatory to
use one).

Am i missing something?

Thanx,
Freddy.

P.S.: I've debugged the RequestProcessor and it seems to be stopping -
without throwing an exception or anything else - when trying to execute the
following line:

RequestDispatcher rd = getServletContext().getRequestDispatcher(uri);

and my web application's context root is "wa"
(http://localhost:8080/wa/createCustomer.do)


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

Reply via email to