How to pass client Locale to remote EJB Bean via JNDI

337 views Asked by At

I have a problem regarding the localization of custom bean validation exceptions like ConstraintViolationException that are thrown at remote EJB Beans.

The JSF web application uses german locale and calls remote EJB Beans of an EAR that runs at englisch default locale. When a bean validation exceptions is thrown they are created using english locale.

Is there a way to pass the client locale to the remote bean (transaction) like defining it in JNDI lookup?

At client I extract the messages like:

final ConstraintViolationException cve = (ConstraintViolationException) e;

for (final ConstraintViolation<?> cv : cve.getConstraintViolations())
    context.addMessage(null, FacesMessageUtils.getMessage(context, FacesMessage.SEVERITY_ERROR, cv.getMessage()));
0

There are 0 answers