ejb-spec
  1. ejb-spec
  2. EJB_SPEC-84

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

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.2
    • Fix Version/s: Future version
    • Labels:
      None

      Description

      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.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            marina vatkina
            Reporter:
            ljnelson
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: