Eric, although you can use session, if you're trying to achieve a RESTful architecture for your application, you should not do that.
Besides it, I think you can easily get the user locale info from the request. You can inject the HttpServletRequest and call getLocale() from it. If you want to cache this information (and you should!) you can activate the some CacheManager and save the locale into it. Later you can easily retrieve this information by injecting the CacheManager into the Service and get the data. -- D. Reinert On Mon, Nov 4, 2013 at 4:40 PM, Eric Stein <[email protected]> wrote: > I'd like to track my current user's Locale for a RESTful web application. > It seems to me that that information is part of the "current user" > information, and so it should be tracked by Shiro .. is that reasonable? If > so, is the Shiro session the correct place to keep track of user values > like that? If so, what's the correct place in the Shiro framework to push > the locale into the session? I figured it would happen during > authentication in my realm's doGetAuthenticationInfo() call, but I'm not > certain. > > If the session isn't the right place for it, does that belong as part of > the Principal, or is it orthogonal to Shiro and I'm trying to fit a square > peg in a round hole? > > Thanks, > Eric >
