This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

problem using bean message bean:message  RSS feed

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i am using LookupDispath Action in my struts app.

the multiple submit buttons in my jsp are:

<html:form action="/Admin">
<table height="300">
<tr>
<td>
<html:submit property="method" >
<bean:message key="button.changeOwner" />
</html:submit>
</td>
<td>
<html:submit property="method" >
<bean:message key="button.newRG"/>
</html:submit>
</td>
</tr>
</table>
</html:form>

the entries in ApplicationResources File are :

button.changeOwner=Change Owner
button.newRG=New Report Group

the key Method Map is :

protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put("button.changeOwner", "ChangeOwner");
map.put("button.newRG", "NewRG");
return map;
}

The Problem is that i am getting :

???en_US.button.changeOwner???
and
???en_US.button.newRG???

as my button labels.

when i try to use the "value" attribute of "submit" button and change the key method map as :

protected Map getKeyMethodMap() {
Map map = new HashMap();
map.put("Change Owner", "ChangeOwner");
map.put("button.newRG", "NewRG");
return map;
}


the button labels are fine but i get the error as :

javax.servlet.ServletException: Action[/Admin] missing resource 'Change Owner' in key method map

Please help me to get the button labels right without the exception.

thanks
sameer
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question marks are an indication that Struts can't find your resources file. Verify that you have an entry similar to:

<message-resources parameter="com.mycompany.resources.ApplicationResources"/>

in your struts-config.xml file, and that the package and file are in your WEB_INF/classes directory.
 
sameer kumar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx a lot merrill, my problem has been resolved.

the actual problem was that i had given the complete path as

<message-resources parameter="/WEB-INF/classes/ApplicationResources"/>

when i changed it to

<message-resources parameter="/ApplicationResources"/>

it worked.

thanx
sameer
 
We begin by testing your absorbancy by exposing you to this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!