网站后台只有管理者能够登陆,为了避免有些游客可能知道了后台的IE地址
在后台的每一页的后台页面中都增加了
if(session.getAttribute("name")==null)
response.sendRedirect("login.jsp");
或者:
if(session.getAttribute("name")=="")
response.sendRedirect("login.jsp");都不能避免,请问怎么解决上面的问题?
在后台的每一页的后台页面中都增加了
if(session.getAttribute("name")==null)
response.sendRedirect("login.jsp");
或者:
if(session.getAttribute("name")=="")
response.sendRedirect("login.jsp");都不能避免,请问怎么解决上面的问题?
在web.xml中配置头文件:
<jsp-config>
<jsp-property-group>
<url-pattern>/selldir/*</url-pattern>><!-- 要过滤的文件 -->
<include-prelude>/include/head.jspf</include-prelude><!-- 页面头部 -->
</jsp-property-group>
</jsp-config>
head.jspf是个jsp文件,你可以在里面写上你要验证的代码。