亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么不放行

public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2) throws IOException, ServletException

{


HttpServletRequest request = (HttpServletRequest) arg0;

HttpServletResponse response = (HttpServletResponse) arg1;

HttpSession session = request.getSession();

? ? if(session.getAttribute("username")!=null)

{

arg2.doFilter(arg0, arg1);//允許放行!

}

? ? else

{

response.sendRedirect(request.getContextPath()+"/login.jsp");

}

}


正在回答

1 回答

request.getContextPath()+去掉應該就可以了


0 回復 有任何疑惑可以回復我~
#1

大LOVE輝 提問者

非常感謝!
2016-08-10 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

為什么不放行

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號