File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with action message.

 
prashant kond
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
prashant kond
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for detailed solution. sorry for late reply.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic