struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Neville" <>
Subject RE: how to check if html:errors will display anything
Date Wed, 09 Jun 2004 08:52:18 GMT
Well, I was using this tag earlier in the week. (We've been trying to stay away from any Struts
specific tags until recently too - we're locked in now anyway,  so we might as well).

It seemed when I was setting errors, the jsp I forwarded to would not show them. I tried adding
a message, and then both were shown.
I came to the conclusion (maybe I little rashly) that 'messagesPresent' solely checked for
messages; upon reading that snippet of the docs, it appears i'm wrong.

I did actually attempt to use the tag with <logic: messagesPresent messages="false|true">
in the hope that I could modify the behaviour, but to no avail.

I think i'll grab the logic tag source and work out what is *actually* happening here ;)



-----Original Message-----
From:	Riyad Kalla []
Sent:	Wed 6/9/2004 7:18 AM
To:	Struts Users Mailing List
Subject:	Re: how to check if html:errors will display anything
I can relate completely to the desire to not have scriplets..

However today is your lucky day, because logic:messagesPresent's
defintiion is to actually check for ActionMessages, ActionErrors and a
few other things, def:
"Evaluates the nested body content of this tag if an ActionMessages 
object, ActionErrors object, a String, or a String array is in request
scope. If such a bean is not found, nothing will be rendered."

from here:

so it seems that does what you need it to?

On Tue, 08 Jun 2004 12:21:35 +0100, James Neville
<> wrote:
> Funny you bring this up, as our gfx guy here would like the same thing.
> It did in fact confuse me for ages why on earth errors wern't being
> displayed, until I realised that <logic:messagesPresent> tag only
> checked for messages (obvious I suppose).
> It seems to me that the abscence of an accompanying <html:errorsPresent>
> tag is an oversight; or was there a particular reason for it?
> Riyad Kalla wrote:
> >
> > However if you just want to check for any errors at all, this should
> > do the trick:
> > <logic:notEmpty name="<%= Globals.ERROR_KEY %>">
> > </logic:notEmpty>
> Good suggestion, but after all the pain i've gone through to get rid of
> scriptlets (as simple as the above might be), I just couldn't bear doing
> this to my pages ;)
> Cheers
> James.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

This e-mail is confidential. If you have received it in error, you are on notice of its status.
Please notify us immediately by reply e-mail and then delete this message from your system.
Please do not copy it or use it for any purposes, or disclose its contents to any other person;
to do so could be a breach of confidence. Thank you for your cooperation. Please contact +44
(0) 20 72037300 or email if you need assistance.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message