• 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

problem with action message.

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for detailed solution. sorry for late reply.
 
reply
    Bookmark Topic Watch Topic
  • New Topic