Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8597583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:56:44+00:00 2026-06-12T00:56:44+00:00

In a grails app, I’m successfully getting the language the user has selected(added to

  • 0

In a grails app, I’m successfully getting the language the user has selected(added to url, “…?lang=xx_XX”) like this:

def locale = RequestContextUtils.getLocale(request)

Using springsecurity, and got a special logout handler set up that works fine

grails.plugins.springsecurity.logout.handlerNames = ['securityContextLogoutHandler', 'myLogoutHandler']

I need to get the user selected locale in myLogoutHandler, but the following is not working (it only shows the browser default locale, not the one selected by the user)

class MyLogoutHandler implements LogoutHandler {
    void logout(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) {
        def locale2 = RequestContextUtils.getLocale(httpServletRequest);
    }
}

I have also tried getting the session locale with:

RequestContextHolder.currentRequestAttributes().getProperties()

but that gives the same result, anyone got an idea how to get the locale from the MyLogoutHandler?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T00:56:46+00:00Added an answer on June 12, 2026 at 12:56 am

    Workaround

    The session appears to be cleared by spring-security but you can still send in parameters.

    so in the controller for the logout page I got:

    def index = {
        def myParam = "bar"
        redirect(uri: SpringSecurityUtils.securityConfig.logout.filterProcessesUrl + "?foo=" + myParam) // '/j_spring_security_logout'
    }
    

    And I just get the parameter in the LogoutHandler:

    void logout(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) {
        def myParam = httpServletRequest.parameterMap.get("foo")[0]
        ....
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page X in my grails app which has a button to
This is my current scenario: I have checked in my grails app code +
I'm writing a Grails app which I'd like 3rd parties to augment at runtime.
I'm trying to deploy my Grails-app (1.3.7) on Heroku. I downloaded the Heroku-plugin, added
My grails app has to define some additional behaviour for many of the standard
My Grails app has the following domain objects class ProductType { String name static
We are developing Grails-app that uses Stark Security for auth/authz. I recently added Jawr-plugin
For my Grails App i use Searchable Plugin to have an nice google-like Search.
I'd like to have a mobile interface for my Grails app, and am wondering
I am designing a grails app and many many-to-many relations have me stumped. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.