Sunday 15 June 2014

grails - How to retrieve the current visited page (controller+action) via spring security -



grails - How to retrieve the current visited page (controller+action) via spring security -

as note , question not " how check if user connected or not ", rather , question explicitly "how check if user connected on specific page "

concretely , how retrieve current controller/action browsed currentuser

i have solution using ajax, , thing there lack of performance :

js(report url): <script> var cname='${controllername}'; var aname='${actionname}'; setinterval(function(){ $.post('user/myurl',{c:cname,a:aname}); },10000) </script> controller: def myurl(){ def u=user.get(springsecurityservice.currentuser.id) u.lasturl=params?.c+'/'+params?.a u.lasturlupdated=new date() u.save() } is there built-in solution via spring security 4 ?

grails spring-security

No comments:

Post a Comment