javaee / ejb-spec

See javax.ejb project for API. Contains legacy issues only.
https://github.com/javaee/javax.ejb
6 stars 1 forks source link

Add getLocale() to javax.ejb.EJBContext with semantics similar to ServletRequest#getLocale() #84

Open glassfishrobot opened 11 years ago

glassfishrobot commented 11 years ago

Please consider adding the following method to javax.ejb.EJBContext:

/**
 * Returns the caller's preferred {@link Locale}, if available.
 * If no caller {@link Locale} can be determined, then this 
 * method returns the value returned by {@link 
 * Locale#getLocale()}.  This method never returns {@code 
 * null}.
 *
 * @return the {@link Locale} that the caller would prefer
 * any localized content to be generated for, or if no such 
 * {@link Locale} is available, the {@linkplain default
 * Locale</tt> for the system}; never {@code null}
 */
public java.util.Locale getLocale();

Rationale

Many times the business logic inside an EJB needs to know the Locale of its caller. While obviously a Locale can be passed in to any EJB method in its parameter list, a container-provided facility for offering up the caller's Locale automatically would be very convenient.

Affected Versions

[3.2]

glassfishrobot commented 11 years ago

Reported by @ljnelson

glassfishrobot commented 11 years ago

Was assigned to mvatkina

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA EJB_SPEC-84