struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Hegarty <matthew.hega...@morse.com>
Subject RE: ActionMessages won't display
Date Mon, 19 Apr 2004 15:43:44 GMT
Cracked it.
I cut and paste your code snippet in, and confirmed the body of 'messagesPresent' is being
output.
So maybe the message was being output, and it just happened to be a blank string.
This appears to be the case - as soon as I put the correct message into 'application.properties'
(the default bundle) the message appeared.
I thought struts warned about this, but for some reason that didn't happen in this case.

Thanks again for your help guys.


-----Original Message-----
From: mike.raath@barclayscapital.com
[mailto:mike.raath@barclayscapital.com]
Sent: 19 April 2004 16:14
To: user@struts.apache.org
Subject: RE: ActionMessages won't display


Sorry for missing that Matt.

The id = 'varName' is the object name which will hold each message in the
messages list as it iterates through.

All you should need is something along the following:

<logic:messagesPresent message="true">
<!-- are there any ActionMessages present? -->
	<html:messages id="message" message="true">
		<c:out value="${message}" /><br />
	</html:messages>
</logic:messagesPresent>

This will examine the request for an ActionMessages object, then iterate
through it assiging each item to object "message". Then the c:out tag will
output the value of message and add a <br /> as a line break.

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

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


Mime
View raw message