Home How to display a flash message in login page
Reply: 0

How to display a flash message in login page

user1057 Published in June 19, 2018, 7:52 pm

I'm using Grails 3.2.7 along with spring-security-core:3.1.1, I want to set a message to the flash object from a controller upon logout, then I need to display this message in my login screen (auth.gsp)

see the below code I wrote.

In controller

if(condition 1){ 
flash.message = "logged out successfully and your claim id is 12345"; redirect(uri:"/logout"); 
}else if(condition b){ 
flash.message = "logged out"; redirect(uri:"/logout"); 
}else if(condition c){ 
flash.message = "multiple login is not allowed"; redirect(uri:"/logout"); 

In the auth.gsp

<g:if test='${flash.message}'>
<div class="login_message">${flash.message}</div>

I could not see this message. Does anyone know how to display this message?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.317152 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO