JSF navigation redirect to previous page

前端 未结 7 1553
一向
一向 2020-12-09 07:06

Once the user successful login to the system, the system will redirect the user to the homepage. Now my problem is, if the user clicks on the view account page without login

相关标签:
7条回答
  • 2020-12-09 07:34

    You haven't described any framework facilities you use for authentication so I assume that you perform authentication in own code. Probably, the simplest approach would be to save initial destination in session before redirecting to the login page, and then after successful login you can check this attribute and redirect to right place. I particular for JSF you can do this in action method that processes login. Actually, I'd suggest to use some framework for authentication, for example Spring Security, because it does such things out of box, and it will be much easier to extend your security system in case you need some additional features, though it needs some additional configuration

    0 讨论(0)
提交回复
热议问题