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 
;)

Cheers,

James.


-----Original Message-----
From:   Riyad Kalla [mailto:[EMAIL PROTECTED]
Sent:   Wed 6/9/2004 7:18 AM
To:     Struts Users Mailing List
Cc:     
Subject:        Re: how to check if html:errors will display anything
James,
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: http://jakarta.apache.org/struts/userGuide/struts-logic.html#messagesPresent

so it seems that does what you need it to?

On Tue, 08 Jun 2004 12:21:35 +0100, James Neville
<[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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






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 [EMAIL PROTECTED] if you 
need assistance.

Reply via email to