I have an EJB app and would like to know how I determine what the current locale setting is. If I call Locale.getDefault() I get the default JVM Locale. All of my resource strings have been externalized into resource bundles.
Generally speaking, you don't get the locale in EJB code. One of the strengths of the J2EE platform is the separation of business and presentation logic. The EJBs should be doing business logic, and the locale is only relevant for presentation done by JSPs or servlets (if presentation is handled on the server at all).
Usually, the user will set a preferred language for the site, which you can save in a user profile on the server or in a cookie. Something in the HTTP request may indicate the user's locale, but I'm not sure.
I agree with the previous poster. Locale is usually related to internationalization, which EJB should be independent of. I can think of some usecases where you will have different logic based on locale. If you must, you can pass locale from the presentation layer.
Locale locale = request.getLocale();
This method is actually defined in the ServletRequest interface. The value you receive will depend on the the locale set when the http request (or user's browser). Locale.getDefault() always returns the locale of the JVM and hence should not be trusted.
Long story short, pass the locale to the business layer if you have to. BUT try not to pass the Locale object itself, pass the String value that way business layer is less dependent on the [http] presentation layer