You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Ben <ne...@gmail.com> on 2004/10/19 09:04:16 UTC

Omit square brackets in ErrorsTool

Hi

Why ErrorsTool outputs the square brackets on every error messages?
What can I do to ignore those square brackets?

ErrorTool outputs:

[Required field cannot be left blank.]

I want:

Required field cannot be left blank.

Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Omit square brackets in ErrorsTool

Posted by Ben <ne...@gmail.com>.
Thanks Shinobu, it outputs the error messages as expected (no brackets).

Ben

On Tue, 19 Oct 2004 17:57:49 +0900, Shinobu Kawai
<sh...@gmail.com> wrote:
> 
> Hi Ben,
> 
> > I don't use errors.(header|footer|prefix|suffix) and I don't have
> > brackets in my messages.
> Okay.
> 
> > I use the following code to show the error messages:
> >
> > In my action:
> >
> > ActionMessages errors = new ActionMessages();
> > errors.add(ActionMessages.GLOBAL_MESSAGE,
> >    new ActionMessage("errors.username");
> > saveErrors(request, errors);
> >
> > In my VM page:
> >
> > $errors.username
> There you have it.  You're rendering the whole set of errors.  For
> example uses of your error messages, take a look at VM_global_library.vm.
> 
> > How do I use the errors.(prefix|suffix)? In my properties file I have them as:
> >
> > errors.prefix=<div class="red">
> > errors.suffix=</div>
> >
> > But ErrorsTool doesn't pick them up.
> Yeah, I just found that out and filed a bugzilla report and patch:
>     http://issues.apache.org/bugzilla/show_bug.cgi?id=31768
> 
> 
> 
> Best regards,
> -- Shinobu Kawai
> 
> --
> Shinobu Kawai <sh...@gmail.com>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Omit square brackets in ErrorsTool

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Ben,

> I don't use errors.(header|footer|prefix|suffix) and I don't have
> brackets in my messages.
Okay.

> I use the following code to show the error messages:
> 
> In my action:
> 
> ActionMessages errors = new ActionMessages();
> errors.add(ActionMessages.GLOBAL_MESSAGE,
>    new ActionMessage("errors.username");
> saveErrors(request, errors);
> 
> In my VM page:
> 
> $errors.username
There you have it.  You're rendering the whole set of errors.  For
example uses of your error messages, take a look at VM_global_library.vm.

> How do I use the errors.(prefix|suffix)? In my properties file I have them as:
> 
> errors.prefix=<div class="red">
> errors.suffix=</div>
> 
> But ErrorsTool doesn't pick them up.
Yeah, I just found that out and filed a bugzilla report and patch:
    http://issues.apache.org/bugzilla/show_bug.cgi?id=31768

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <sh...@gmail.com>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Omit square brackets in ErrorsTool

Posted by Ben <ne...@gmail.com>.
I don't use errors.(header|footer|prefix|suffix) and I don't have
brackets in my messages.

I use the following code to show the error messages:

In my action:

ActionMessages errors = new ActionMessages();
errors.add(ActionMessages.GLOBAL_MESSAGE,
   new ActionMessage("errors.username");
saveErrors(request, errors);

In my VM page:

$errors.username

How do I use the errors.(prefix|suffix)? In my properties file I have them as:

errors.prefix=<div class="red">
errors.suffix=</div>

But ErrorsTool doesn't pick them up.

Thanks.

On Tue, 19 Oct 2004 16:31:07 +0900, Shinobu Kawai
<sh...@gmail.com> wrote:
> 
> Hi Ben,
> 
> 
> 
> > Why ErrorsTool outputs the square brackets on every error messages?
> > What can I do to ignore those square brackets?
> >
> > ErrorTool outputs:
> >
> > [Required field cannot be left blank.]
> >
> > I want:
> >
> > Required field cannot be left blank.
> Funny, my errors come out as is.  How are you showing your error
> messages?  Are you sure the brackets aren't in your messages?  And your
> errors.(header|footer|prefix|suffix) as well?
> 
> Best regards,
> -- Shinobu Kawai
> 
> --
> Shinobu Kawai <sh...@gmail.com>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Omit square brackets in ErrorsTool

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Ben,

> Why ErrorsTool outputs the square brackets on every error messages?
> What can I do to ignore those square brackets?
> 
> ErrorTool outputs:
> 
> [Required field cannot be left blank.]
> 
> I want:
> 
> Required field cannot be left blank.
Funny, my errors come out as is.  How are you showing your error
messages?  Are you sure the brackets aren't in your messages?  And your
errors.(header|footer|prefix|suffix) as well?

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <sh...@gmail.com>


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org