Showing whats stored under the errors key proves nothing - its actually the
<html:errors> tag that loads the message from the message resources. What
you see under the errors key is an ActionMessages object which contains an
ActionMessage. ActionMessage contains the key to the message in the message
resources (mysite.globalerrors.database_config in your case) plus any
replacement arguments. Now it just so happens that the exception handler
passes the "message" from the exception as an argument, but you still need
to have a message for that key in your application resources. Probably
something that looks like this...

mysite.globalerrors.database_config={0}

.. so that it basically just displays the exception's message which was
passed as the argument.

Niall

P.S. Please don't cross-post messages to more than one list. It gets
confusing when people are replying to the same message on different lists -
especially for people not subscribed to both. There are guidelines here for
the mailing lists:

http://struts.apache.org/mail.html


----- Original Message ----- 
From: "Adam Jenkins" <[EMAIL PROTECTED]>
Sent: Thursday, March 03, 2005 4:47 PM


> Yep, and it's loaded ok as you can see it in the toString on the errors
> object:
>
> > And a tostring on org.apache.struts.action.ERROR =
> >
{mysite.globalerrors.database_config=[mysite.globalerrors.database_config[T
> >h e
> > site is not configured correctly: Required database configuration data
was
> > missing.]]}
>
>
> On Fri, 4 Mar 2005 12:16 am, Niall Pemberton wrote:
> > Does the "mysite.globalerrors.database_config" key exist in your
> > application resources?
> >
> > Niall
> >
> > ----- Original Message -----
> > From: "Adam Jenkins" <[EMAIL PROTECTED]>
> > To: <dev@struts.apache.org>; <user@struts.apache.org>
> > Sent: Thursday, March 03, 2005 7:39 AM
> > Subject: direction of effort request please?
> >
> >
> >
> > Hi Guys, I'm having some issues with <html:errors/> (I've attached my
> > previous
> > mail below) that I'm going to write a custom tag to get around.  I was
> > thinking that if it's a bug, my effort is probably more productively
used
> > fixing the bug than rewriting the functionality, but first I need to
know
> > if it is a bug or not.  Can anyone help me out (feel free to email me
> > directly for more information)?
> >
> > Cheers
> > Adam
> >
> >
> > ----previous email------------
> >
> >
> > Hi Guys,
> >
> > I'm trying to come to terms with <html:errors/>...it's working ok, I'm
> > using the following for prefixes etc:
> >
> > #error formatting information
> > errors.header=<font color="red"><center><p>Some errors occured
validating
> > the
> > form. Please correct the following errors and try
again.</p></center><ul>
> > errors.footer=</ul></font>
> > errors.prefix=<li>
> > errors.suffix=</li>
> >
> > Which is working great when there are form validation errors, however,
to
> > get
> > to the page that has the form, I use a global exception redirect as
such:
> >
> > <exception
> > key="mysite.globalerrors.database_config"
> > path="/private/install/ConfigDB.jsp"
> > scope="request"
> > type="com.mysite.utils.DBMissingConfigDataException"/>
> >
> > And a tostring on org.apache.struts.action.ERROR =
> >
{mysite.globalerrors.database_config=[mysite.globalerrors.database_config[T
> >h e
> > site is not configured correctly: Required database configuration data
was
> > missing.]]}
> >
> > Now this is all well and good, except my <html:errors/> tag now prints
out
> > the
> > header, and footer with one prefix and suffix in between (and no error
> > message) when the page first loads (from the error redirect). When there
is
> > form validation errors everything works fine, however it's just that
> > initial redirect where everything goes haywire.
> >
> > Does anyone know what's going on and/or how to fix?
> >
> > Cheers
> > adam



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

Reply via email to