struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <david.k...@wamu.net>
Subject RE: ActionMessages and Struts-EL Tags
Date Tue, 14 Dec 2004 18:59:57 GMT
This isn't a Struts-EL issue.  The "html:messages" tag can be used to
iterate over either messages or errors, but not both.  It defaults to
errors.  You can change it to iterate over messages by setting the
"message" atttribute to "true".

> -----Original Message-----
> From: Hariharan V [mailto:hariharan1005@gmail.com] 
> Sent: Tuesday, December 14, 2004 12:50 AM
> To: Struts Users Mailing List
> Subject: ActionMessages and Struts-EL Tags
> 
> 
> In my application I want to differentiate b/w error and 
> normal messages
> 
> Here is the code in my Controller 
> 
> 
>             ActionMessages messages = new ActionMessages();
>             ActionMessages errors = new ActionMessages();
>             
>             messages.add("sample.message", new 
> ActionMessage("sample.message"));
>             messages.add("sample.message2", new 
> ActionMessage("sample.message2"));
>             
>             errors.add("sample.error", new 
> ActionMessage("sample.error"));
>             errors.add("sample.error2", new 
> ActionMessage("sample.error2"));
> 
>             super.addMessages(req, messages);
>             super.addErrors(req, errors);
> 
> 
> in my jsp I have added following piece of code
> 
> 		<html-el:errors/>
> 
> 		<html-el:messages id="message">
> 			<c:out value="${message}"/>		
> 		</html-el:messages>		
> 
> 	But the problem is that I see only error messages in 
> the output , 
> I don't get hold of my normal messages using <html-el:messages> tag.
> 
>  		Sample Error
> 		Sample Error2
> 
> 		Sample Error
> 		Sample Error2 
> 
> Resource Bundle entries
> 
> sample.error=Sample Error
> sample.error2=Sample Error2
> sample.message=Sample Message
> sample.message2=Sample Message2
> 
> Is anything wrong with the way Iam storing errors and normal messages
> 
> -- 
> -Hari
> 
> ---------------------------------------------------------------------
> 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