• <menu id="w2i4a"></menu>
  • 首頁 > 慧問 > 頻道

    ChartDirector用了jsp過濾器后不出圖

    發(fā)表于2020-05-26 回復(fù):1 查看:3538  |  

    一、jsp代碼

    String chart1URL = c.makeSession(request, "chart1");

    <img src='<%=response.encodeURL("getchart.jsp?"+chart1URL)%>'   usemap="#map1" border="0">

    二、過濾器代碼

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {

    HttpServletRequest req=(HttpServletRequest)request;

    HttpServletResponse resp=(HttpServletResponse)response;

    HttpSession session=req.getSession(true);

    resp.setContentType("text/html");

    resp.setCharacterEncoding("UTF-8");

    PrintWriter out=resp.getWriter();

    String request_uri=req.getRequestURI();

    String ctxPath=req.getContextPath();

    String uri=request_uri.substring(ctxPath.length());

    if(uri.contains("Login.jsp")||uri.contains("Login")||uri.contains("getchart")||uri.contains(".png")||uri.contains(".jpg")||uri.contains(".css")||uri.contains(".js")||uri.contains("testchart.jsp")) {

    chain.doFilter(request, response);

    }else {

    if(null !=session.getAttribute("user")) {

    chain.doFilter(request, response);

    }else {

    out.println("您還沒有登錄,請先登錄!3秒后回到登錄頁面。");

    resp.setHeader("refresh","3;url="+ctxPath+"/Login.jsp");

    return;

    }

    }

    }

    三、問題

    無過濾器,顯示正常,上了過濾器后網(wǎng)頁不出圖。


    0個回答

    打破零回復(fù)...

    回復(fù)

    登錄 慧都網(wǎng)發(fā)表評論

    掃碼咨詢


    添加微信 立即咨詢

    電話咨詢

    客服熱線
    023-68661681

    TOP
    三级成人熟女影院,欧美午夜成人精品视频,亚洲国产成人乱色在线观看,色中色成人论坛 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();