Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Roland Blochberger
HttpServletRequest attributes statically (threadlocal) available?
September 11, 2008 1:20 AM
Answer

Roland Blochberger

Rank: New Member

Posts: 7

Join Date: September 3, 2008

Recent Posts

Is there a way to obtain attributes from the HttpServletRequest (or PortletRequest) in a static way? I would need the request Locale outside the typical Struts/Servlet classes but inside their processing sequence. (see also Locale dependent view permission for pages
Roland Blochberger
RE: HttpServletRequest attributes statically (threadlocal) availa
September 12, 2008 12:15 AM
Answer

Roland Blochberger

Rank: New Member

Posts: 7

Join Date: September 3, 2008

Recent Posts

After a valuable hint from Stanislav Mores I could solve the problem by putting the user's selected Locale into a ThreadLocal Singleton. This is done in an Action class that is configured to run first in the list of servlet.service.events.pre. The methods of the extended PermissionChecker can obtain the Locale from the Singleton whenever it is needed.
Brian Scott Schupbach
RE: HttpServletRequest attributes statically (threadlocal) availa
June 12, 2013 12:27 PM
Answer

Brian Scott Schupbach

Rank: Expert

Posts: 329

Join Date: October 23, 2008

Recent Posts

Hi Roland,

I'm attempting to do something similar. Could you provide any insights on how you did this? Any help you could provide would be much appreciated.

Thanks,

Brian