Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
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:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Struts
ActionMessage not iterating
Pranav Sharma
Ranch Hand
Posts: 261
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi
I'm adding ActionMessages in my Action using the following code:
ActionMessage message = new ActionMessage(key.error1); ActionMessages messages = new ActionMessages(); messages.add("message1", message); message = new ActionMessage(key.error2); messages.add("message2", message); saveMessages(request, messages);
and then use this piece to display the error in
jsp
<html:messages id="messageId" message="true" /> <logic :-P resent name="messageId"> <bean:write name="messageId" /> </logic :-P resent> </html:messages>
but only the first message is displayed. what am i doing wrong??
[ December 09, 2005: Message edited by: mannu kapoor ]
Merrill Higginson
Ranch Hand
Posts: 4864
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Try removing the <logic:present> tags, as they aren't necessary. Also, if the messages apply to the whole page and not just one field in the page, it is better to give ActionMessages.GLOBAL_MESSAGE as the message Id as in:
messages.add(ActionMessages.GLOBAL_MESSAGE, message);
Merrill
Consultant,
Sima Solutions
Pranav Sharma
Ranch Hand
Posts: 261
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
get a "Cannot find bean messageId in any scope"
servlet
expception if i remove the logic
resent tags.
Also had tried the ActionMessages.GLOBAL_MESSAGE arg but that dint work either...
any ideas
Pranav Sharma
Ranch Hand
Posts: 261
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
but this worked
<logic:messagesPresent> <html:messages id="err"> bean:write name="err" /> </html:messages> </logic:messagesPresent>
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
html:messages ActionMessages Action
How can I have global and specific html:errors?
ActionMessage is not working
Issues with <html:messages >
Error Message Not Displaying on JSP(URGENT)
More...