aspose file tools*
The moose likes JSF and the fly likes JSF 2.0 problem with customizing validation messages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF 2.0 problem with customizing validation messages" Watch "JSF 2.0 problem with customizing validation messages" New topic
Author

JSF 2.0 problem with customizing validation messages

Enrique Villamizar
Ranch Hand

Joined: Jul 30, 2005
Posts: 93
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

Joined: Jan 07, 2010
Posts: 1
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

Joined: Jul 30, 2005
Posts: 93
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

Joined: Jul 30, 2005
Posts: 93
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!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSF 2.0 problem with customizing validation messages