File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes html:messages  does not display messages Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Struts
Reply Bookmark "html:messages  does not display messages" Watch "html:messages  does not display messages" New topic
Author

html:messages does not display messages

Ajai
Ranch Hand

Joined: May 29, 2002
Posts: 198
Hi,
I am facing one problem in error messages display.
my code in Jsp page is as below:-
<%
System.out.println("the messages begin here");
%>
<html:messages id="error">
<LI><bean:write name="error" /></LI>
</html:messages>
<%
System.out.println("the messages end here");
%>
but I get the below output:-
[5/28/04 21:16:22:578 SGT] 693309c0 SystemOut O the messages begin here
[5/28/04 21:16:22:578 SGT] 693309c0 SystemOut O the messages end here
[5/28/04 21:16:22:578 SGT] 693309c0 SystemOut O Going to print the array size
[5/28/04 21:16:22:578 SGT] 693309c0 SystemOut O The length of lists13,13,13
[5/28/04 21:16:23:016 SGT] 693309c0 WebGroup E SRVE0026E: [Servlet Error]-[No collection found]: javax.servlet.jsp.JspException: No collection found
at org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:281)

In my action the error size is one and the message is also available in application.prop file.For the action I am also setting validate as true.
I used the same syntax for some other JSP and it worked fine.

Any ideas???
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4695

Isn't that what <html:errors/> is for???


A good workman is known by his tools.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11945
The JspException is related to the <logic:iterate> tag you've got somewhere else in the JSP, not to your <html:messages> element.


Author of Test Driven (Manning Publications, 2007) [Blog] [HowToAskQuestionsOnJavaRanch]
Ajai
Ranch Hand

Joined: May 29, 2002
Posts: 198
Hi,

Thanks for your reply.
Yes, there is logic:iterate tag.
But if I am getting errors from Action, should not struts write the error message rather than going to logic:iterate tag.Nevertheless the collection used by logic:iterate has values as given in the output.So why the exception is there.
At the same time if there is no error from Action, logic :iterate tag works perfectly fine.


Thanks...
 
 
subject: html:messages does not display messages
 
Threads others viewed
DISPLAYING MESSAGES USING html:messages TAG
How to display ActionMessage?
Struts error message
Message Resources
ActionMessages causing me great distress
developer file tools