permaculture playing cards*
The moose likes Struts and the fly likes Re, Handling Error using ActionMessages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Re, Handling Error using ActionMessages" Watch "Re, Handling Error using ActionMessages" New topic
Author

Re, Handling Error using ActionMessages

Peter Vennel
Ranch Hand

Joined: Dec 18, 2003
Posts: 46
I am trying to store errors in struts using ActionMessages and display them in my jsp page. I get the following error:

ERROR [org.apache.struts.taglib.tiles.InsertTag] - ServletException in '/genericError.jsp': Cannot find bean: "msg" in any scope

My code snippet is as follows:

ActionClass


genericError.jsp



I checked some of the earlier postings and did not see anything that would help in my case.

Any help is appreciated.

Thanks,
Peter
[ October 19, 2007: Message edited by: Peter Vennel ]
A.J. Gibson
Greenhorn

Joined: Sep 16, 2010
Posts: 1
I'm having a problem similar to this in struts1. This code:

<logic:messagesPresent message="true">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table3D">
<tr>
<td class= "SuccessText" height="25">
<html:messages id="msg" messages="true">
<bean:write name="msg"/>
</html:messages>
</td>
</tr>
</table>
</logic:messagesPresent>

results in the error message:

cannot find bean msg in any scope

If I remove messages="true" then I get no error, but no text appears either. The kicker is that I made this jsp by copying an existing jsp, and this code works in the original, but not in the copy, which only has a few changes. This leads me to believe this is some sort of set-up issue, but I don't know what. Can anyone give me a clue?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Re, Handling Error using ActionMessages