Skip to main content

Bean validation localization issue

4 replies [Last post]
laliluna
Offline
Joined: 2005-10-11
Points: 0

Hello,
I tested integration of a snapshot from last week with Hibernate Validator 4.0.0.GA. I just added the parameter INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL to integrate it. The validation works fine but there is an issue with the selected messages.

I have a default language of en and a support language of de. My system language is de_DE. The default ResourceBundleMessageInterpolator cannot find the english default messages as they are stored in a file without _en suffix and falls back to a german bundle. Though the users locale and the locale passed to the interpolator was English.

Should I use a JSF specific interpolator or is this actualy a Hibernate validation bug (my assumption)?

Best Regards

Sebastian Hennebrueder
http://www.laliluna.de

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
laliluna
Offline
Joined: 2005-10-11
Points: 0

Same problem on JSF 2 on glassfish v3 preview

laliluna
Offline
Joined: 2005-10-11
Points: 0

Hello,

I cannot confirm the stack. I am using JSF 2 Snapshot with Hibernate Validator 4 on Jetty 6 app server.

I want to describe the integration with any app server in my article, this is why I am evaluating this case carefully. The problem is right at the border of JSF 2 and the Bean Validation, so it was hard to find who is responsible.

Your setup is correct. You should see english messages though the user is having a de locale.

Best Regards

Sebastian Hennebrueder
http://www.laliluna.de

Ed Burns

>>>>> On Thu, 22 Oct 2009 00:13:20 -0700 (PDT), webtier@javadesktop.org said:

SH> I cannot confirm the stack. I am using JSF 2 Snapshot with Hibernate
SH> Validator 4 on Jetty 6 app server.

SH> I want to describe the integration with any app server in my
SH> article, this is why I am evaluating this case carefully. The
SH> problem is right at the border of JSF 2 and the Bean Validation, so
SH> it was hard to find who is responsible.

SH> Your setup is correct. You should see english messages though the
SH> user is having a de locale.

>>>>> On Thu, 22 Oct 2009 02:44:26 -0700 (PDT), webtier@javadesktop.org said:

SH> Same problem on JSF 2 on glassfish v3 preview

Ok, I'll be integrating a new release of Bean Validator into Glassfish
sometime this week. It will show up in the nightly of Glassfish shortly
thereafter. Can you wait until that's done and try it again? If not,
I'll try to make time to address it right now, but they've been fixing
lots of stuff and it's possible they fixed your issue.

Ed

--
| ed.burns@sun.com | office: 408 884 9519 OR x31640
| homepage: | http://ridingthecrest.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

Ed Burns

>>>>> On Tue, 20 Oct 2009 03:30:49 -0700 (PDT), webtier@javadesktop.org said:

SH> I tested integration of a snapshot from last week with Hibernate
SH> Validator 4.0.0.GA. I just added the parameter
SH> INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL to integrate it. The
SH> validation works fine but there is an issue with the selected
SH> messages.

Please note that the only JSR-303 implementation supported by Glassfish,
and thus Mojarra, is the specially produced OSGi bundle mentioned at
[1]. This implementation is exactly the JBoss JSR-303 RI plus some code
to make sure EE6 guarantees are met. If you are trying to use a
Hibernate Validator build inside of Glassfish, you're on your own and we
can't help you on this forum. In that case, I can refer you to the
Hibernate Jira at [2]. Please confirm that you are using the supported
stack.

SH> I have a default language of en and a support language of de. My
SH> system language is de_DE. The default
SH> ResourceBundleMessageInterpolator cannot find the english default
SH> messages as they are stored in a file without _en suffix and falls
SH> back to a german bundle. Though the users locale and the locale
SH> passed to the interpolator was English.

I understand what you are trying to do. I think this will reproduce
your scenario.

I have a default language of de and a supported language of en. My
system language is en_US. The default ResourceBundleMessageInterpolator
cannot find the German default messages as they are stored in a file
without the _de suffix and falls back to the English bundle, though the
user's locale, and the locale passed to the interpolator is German.

If I set my system up like that, does that accurately replicate your
problem?

Thanks.

Ed

[1] http://wiki.glassfish.java.net/Wiki.jsp?page=V3Jsr303BeanValidationInteg...

[2] http://opensource.atlassian.com/projects/hibernate/

--
| ed.burns@sun.com | office: 408 884 9519 OR x31640
| homepage: | http://ridingthecrest.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net