• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

html:messages does not display messages

 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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???
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Isn't that what <html:errors/> is for???
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JspException is related to the <logic:iterate> tag you've got somewhere else in the JSP, not to your <html:messages> element.
 
Ajai
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Curse your sudden but inevitable betrayal! And this tiny ad too!
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic