aspose file tools*
The moose likes Struts and the fly likes problem with action message. 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 "problem with action message." Watch "problem with action message." New topic
Author

problem with action message.

prashant kond
Greenhorn

Joined: Mar 03, 2005
Posts: 18
Hi
I am using action messages in my jsp. while displaying it is adding extra charecters. If any one having idea please let me know.

My requirement to display only "AA-JDBC Name already exists."
but it is displaying in this way as action message.

???en_US.AA-JDBC Name already exists.???

my jsp code is:
<tr>
<td valign="top">
<div id="messageTable" style="display:none">
<table width="100%" class="ADPUI-messageError">
<tr>
<logic:messagesPresent message="true">
<td style="padding-left:30px">
<html:messages id="msg" message="true">
<bean:write name="msg"/>
</html:messages> </td>
<td>
</logic:messagesPresent>
</tr>
</table>
</div>
</td>
</tr>
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The problem is not in your JSP code, but in the code that creates the ActionMessage. An ActionMessage is intended to be populated by a message key that exists in the ApplicationResources.properties file. It is not intended to be populated by a literal string as you are apparently doing. Try adding the following to your ApplicationResources.properties file (or whatever message resource file is defined in your struts-config.xml file)

and changing the code that creates the message so it looks something like this:

After telling you all this, if you really prefer not to have your messages in the ApplicationResources.properties file, you can specify a literal when creating a message like this:

The second parameter tells struts this is a literal message, and not a message key.

See this link for more information on Struts messages.
[ February 22, 2007: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
prashant kond
Greenhorn

Joined: Mar 03, 2005
Posts: 18
thanks for detailed solution. sorry for late reply.
 
 
subject: problem with action message.