Hi Brian,
I had a problem like that when I ommited the following values from my
ApplicationResources file:
errors.header = <ul>
errors.footer = </ul>
errors.prefix = <li>
errors.suffix =
Once I added them it worked fine.
Regards
IV
> from: Brian McSweeney <[EMAIL PROTECTED]>
> date: Wed, 02 Jul 2003 10:28:03
> to: [EMAIL PROTECTED]
> subject: Re: <html:errors/> problems
>
> Hi all,
>
> I'm trying to display errors on a jsp to which my form returns if the
> data submitted is invalid.
>
> My form extends org.apache.struts.validator.ValidatorForm
>
> some fields use the validator form validation, but for custom server
> side validation I overwrite the
> validate method as follows:
>
> public ActionErrors validate( ActionMapping mapping,
> HttpServletRequest request ) {
> // this should call the validate on the automatic stuff
> super.validate( mapping, request );
> ActionErrors errors = new ActionErrors( );
>
> customCheck1( getFormField1(), "messagebundle.customError1",
> errors );
> customCheck2( getFormField2(), "messagebundle.customError2",
> errors );
>
> return errors;
> }
>
> then in the same class I have my custom methods, eg:
>
> private void customCheck1( String value, String msg, ActionErrors
> errors ) {
> if ( value.equalsIgnoreCase("whatever") {
> String message = ResourceBundle.getBundle( "mybundle"
> ).getString( key )
> errors.add( ActionErrors.GLOBAL_ERROR , new ActionError(
> message ) );
> }
> }
>
>
> Now, I know this is getting called, due to debug that I have included.
> I'm successfully getting all the error messages from the resource bundle
> etc.
> In my jsp I have the following tag to try to output the ActionError
> messages
>
> <html:errors/>
>
> What's happening is, my jsp is being validated, but the messages just
> aren't
> getting outputted. I'm getting white space where the messages should be,
>
> and when I look at the source I see that
> <br> lines are being created for (what I assume is) each ActionError.
>
> If anyone can give me advice/help, I'd really appreciate it.
> thanks,
> Brian
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]