thanks for your reply, jeff.

i wasn't aware that struts 1.0.2 used a validation.xml file. there is
nothing like that anywhere on my system. besides, it's not the validation
that is the problem. the validation is working fine. the problem is that the
paramater being passed into the ActionError constructor isn't being included
in the error message that is being output.

----- Original Message -----
From: "Jeff Kyser" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, February 23, 2003 3:06 AM
Subject: Re: Help: ActionError - <html:errors /> does not expand the
{0}placeholder


> So what does your validation.xml file look like w.r.t. the rule in
> question?
>
> -jeff
>
> On Saturday, February 22, 2003, at 09:00  PM, w i l l i a m b o y d
> wrote:
>
> > hello all,
> >
> > developing on w98 with tomcat 3.2.24, mysql 3.23.36, struts 1.0.2, jdk
> > 1.3.1., servlet 2.2. will be deploying on basically similar setup; but
> > deployment os is xp.
> >
> > i got a jsp page that has a choice box that allows multiple choices. i
> > set a
> > validation rule in my action form's validate method, that disallows
> > users
> > from selecting more options than permitted by my limit. if a user goes
> > over
> > the limit the form doesn't get submitted. the validation rule is
> > checked
> > just fine; struts creates an error for it and adds it to the errors
> > collection. but the error message that is displayed on the input page
> > does
> > not contain the parameterized message as expected. instead, it shows
> > the
> > complete, unformatted message, exactly (minus an apostrophe) as it
> > appears
> > in the resource bundle! does anybody know what i'm overlooking? is
> > this a
> > bug in 1.0.2?
> >
> > here is what gets displayed (verbatim) on the input page after the
> > validation error is created:
> >
> >       Sorry! Youve selected too many choices for {0}.  (what happened
> > to my
> > apostrophe in "You've" ?)
> >
> > here is the appropriate line from my resource bundle:
> >
> >       error.prefs.limit=Sorry! You've selected too many choices for
> > {0}.
> >
> > here is a snip from my form's validate method:
> >       ...
> >       ActionErrors errors = new ActionErrors();
> >       ...
> >       if ( isTooManyPrefs ) {
> >          ActionError prefMusicError = new ActionError(
> > "error.prefs.limit",
> > "Preferred Music" );
> >   errors.add( "prefMusic", prefMusicError );
> >
> >        }
> >       ...
> >
> > here are the results of me looping through prefMusicError.getValues()
> > inside
> > validate:
> >
> >       error.prefs.limit's replacement value # 0: Preferred Music
> >       error.prefs.limit's replacement value # 1: null
> >       error.prefs.limit's replacement value # 2: null
> >       error.prefs.limit's replacement value # 3: null
> >
> >
> > here is a snip from the input page that generates the validation error
> > and
> > to which struts reports the error:
> >
> >       ...
> >       <td><html:errors />&nbsp;</td>
> >       ...
> >
> > what's going on here? why doesn't struts format the message to include
> > the
> > replacement value. it's obviously there! at least *i* can get at it
> > from the
> > object array that i get from ActionError.getValues()! please, help!
> > thanks
> > in advance.
> >
> > will
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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

Reply via email to