Dear Mr. Hartung,

> Basically, I was trying convert the <s:errors>Body</s:errors> block in to a
> simple "if I have errors, give
> me a message" tag.

>From section 10.3 of the book, "Dealing with a Bunch of Required Fields":

YourActionBean implements ValidationErrorHandler {
  public Resolution handleValidationErrors(ValidationErrors errors) {
    if (errors.hasFieldErrors()) {
      errors.addGlobalError(new SimpleError("All fields are required."));
    }
    return null;
  }
}

JSP:

<s:errors globalErrorsOnly="true"/>

You'll just have the one message at the top, and your lit-up fields below.
Your per-field messages too if you already had 'em.

Hope that helps.
Freddy



------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to