JSP中的通用登录授权 [英] Universal Login Authorization in JSP
本文介绍了JSP中的通用登录授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要有关登录授权的帮助.当我使用我的网页之一的直接链接而不提供凭据(无需登录)时,则需要重定向到登录页面以使用登录凭据进行正确的登录.我该如何使用JSP做到这一点?
I need a help on login authorization. When I use a direct link of one of my web page without providing credentials (without logging in) then I need to be redirected to the login page for proper login with login credentials. How can I go about this with JSP?
推荐答案
-
创建一个过滤器
检查某些会话属性.如果存在,请考虑登录用户,否则
response.sendRedirect("url to login page");
Check for some session attribute . if present consider logged in user , otherwise
response.sendRedirect("url to login page");
这篇关于JSP中的通用登录授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文