User Language in ADF BC

105 views
Skip to first unread message

Alexis Lopez

unread,
Apr 27, 2015, 10:15:40 AM4/27/15
to adf-met...@googlegroups.com
Hello everyone,

I know we have talked before about not accessing HTTPSession from ADF BC since that breaks the MVC architecture that ADF is based on.

Sometimes, user is able to change the language which he/she wants to see the application and this language is saved in the HTTPSession.

What do you think is the best way to access the user selected language from ADF BC?
I'm thinking about overriding the prepareSession method from every ApplicationModule (using my ApplicationModule base class), get the selected language from the HTTPSession and put it in the UserData Map so I can access it in ADF BC or by using groovy.

Any comments are welcome

Florin Marcus

unread,
Apr 27, 2015, 10:24:58 AM4/27/15
to adf-met...@googlegroups.com
Hi Alexis,

If you change the User's Locale programatically and you do it 'properly' through:

FacesContext.getCurrentInstance().setLocale(newLocale)

The language is automatically propagated to your BC layer and you can access it though:

applicationModule.getSession().getLocale()


Thanks,
Florin








--
--
You received this message because you are subscribed to the ADF Enterprise Methodology Group (http://groups.google.com/group/adf-methodology). To unsubscribe send email to adf-methodolo...@googlegroups.com
 
All content to the ADF EMG lies under the Creative Commons Attribution 3.0 Unported License (http://creativecommons.org/licenses/by/3.0/). Any content sourced must be attributed back to the ADF EMG with a link to the Google Group (http://groups.google.com/group/adf-methodology).

---
You received this message because you are subscribed to the Google Groups "ADF Enterprise Methodology Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adf-methodolo...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages