This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF 2.0 problem with customizing validation messages

 
Enrique Villamizar
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:

What I'm trying to do I've already done it with no problems using Netbeans 6.7.1, JSF 1.2 and Tomcat 6.

Now I'm using Netbeans 6.8, JSF 2.0, Java EE 6 and GlassFish v3

1. I created a property file, under the source package com.domain.util, named myMessages.properties
2. I delcared a new message bundle in faces-config.xml


When I run it:



I read some similar problems here ... some said that could be a classpath problem but wrote nothing about solving it.

What should I do? Thanks in advanced for your help.
 
German Escobar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to change the name of the file to myMessages_es.properties. You may also want to add this configuration to the faces-config.xml. I don't know if it is really mandatory but give it a try:




Hope it helps.
 
Enrique Villamizar
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello German:

Sorry...I made a copy-paste mistake mixing two messages of the same problem but two different projects.

The correct one is:


Based on your idea, I renamed myMessages.properties to myMessages_es_CO.properties, I also added to faces-config

But the same problem. This example is based on Jastrologer Validate

Thank you very much for your reply...I'll keep on trying.
 
Enrique Villamizar
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to Jason Porter the problem was solved.

The message bundle that was not working was in the wrong package. My faces-config was wrong ... it didn't say the correct location for the *.propertie file. Of course it was a silly mistake.

Thank you all!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic