Spring Security, display message when log out

Asked

Viewed 817 times

9

I am controlling the session of my application with Spring Security, I have two rules to end the session, max-Session

<session-management>
    <concurrency-control max-sessions="1" error-if-maximum-exceeded="true"
            expired-url="/publico/login.jsp" />
</session-management>

And there’s the timeout

<session-config>
    <session-timeout>20</session-timeout>
</session-config>
  • Fixed the problem? What about the URL /publico/login.jsp, does not work when it expires? What if a file is created . jsp when it expires with the message when it closes the session?

  • I did not solve by spring, what I did was the following, when the time out it cuts my connection to the database and ended up dealing directly in java with Try cat in my connection. It wasn’t the right solution.

1 answer

1

A way to make this message appear saying that the Session closed, is using a parameter in the URL (expired-url="/publico/login.jsp?sessionExpired=sim") and have on the login page a conditional in EL, to check for when this parameter appears in your URL, show the body of the message.

Ex:

${param.sessionExpired}

Use "param" to pick up any type of parameter, it is similar to using "requestScope" to pick up any attribute set in a Session. ${requestScope.nomeDoAtributo}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.