A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Frameworks
»
Struts
Author
Struts Message resources
Meet Gaurav
Ranch Hand
Joined: Oct 08, 2008
Posts: 492
posted
Sep 22, 2010 08:52:33
0
Hi,
Message resources is not working for me.. I tried with different scenario, Please assist us to resolve the issue
Added the file name is Strutsconfig.xml
<!-- Property File Loading -->
<message-resources parameter="MessageResources" null="false" />
My Action Form
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); MessageResources msgRes = (MessageResources) request.getAttribute(Globals.MESSAGES_KEY); if (emailId == null || emailId.trim().equals("")) { String eID = msgRes.getMessage("prompt.customer.emailId"); String[] rplcmntValueArr = { eID }; ActionError err = new ActionError("errors.required", rplcmntValueArr); errors.add("emailId ", err); } return errors; }
Message resources copied to classes path also
prompt.customer.emailId = Email Id is required.
errors.required={0} is required.
emailed=Email Id
But am getting
???en_US. prompt.customer.emailId???
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
I like...
posted
Sep 22, 2010 09:25:44
0
Well, that property isn't defined--what did you expect?
Meet Gaurav
Ranch Hand
Joined: Oct 08, 2008
Posts: 492
posted
Sep 22, 2010 09:37:55
0
On the page am expecting Email Id is required
But am getting ???en_US. prompt.customer.emailId???
Am sorry
I added prompt.customer.emailId on the message properties
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: Struts Message resources
Similar Threads
application.resources don't show me the messages
Struts 1.3 Error messages displaying improperly on jsp
Struts 1.1 upload multiple files with multiple input elements
Getting values from properties in validate-using multiple message-resources in struts
validation error msg with properties file
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter