-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Multiple ValidationMessages.properties in different jars
PostPosted: Wed Feb 19, 2014 12:37 pm 
Newbie

Joined: Wed Feb 19, 2014 12:04 pm
Posts: 1
Hi,

I have the following situation. I'm using JBoss EAP 6.2 and want to deploy two applications:

appl1.jar and appl2.ear
(appl2.ear depends on appl1.jar. appl1.jar is a common application which may be used by other applications, too.)

appl1.jar has a ValidationMessages.properties file under jar/WEB-INF/classes
with the content:
missing_sender = Please provide a sender adress.

appl2.jar has a ValidationMessages.properties file under ear/web/WEB-INF/classes as well. Its content is:
page_field_empty = The field is empty.

If I start the server and validate some input, e.g. check if a field contains data, then I got as error message:
{page_field_empty} instead of "The field is empty".
The logic for this validation is located within a folder (ear/biz/) in the appl2.ear. The used Validator is obtained by:
Code:
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
validator = factory.getValidator();


If I debug all keys of the file ValidationMessages.properties, it only returns as known keys:
missing_sender

I.e. the keys from the ValidationMessages.properties from the jar file: appl1.jar. Thus, the key {page_field_empty} is unknown and the key instead of the value is returned.

So:
How it is possible to load ValidationMessages.properties in its own "context"?
Why does the ear/ValidationMessages.properties file got overwritten by the jar/ValidationMessages.properties?


Thanks for any suggestions and help in advance.

Best regards,
jondoe


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.