Send redirect to relative path in JSP?

前端 未结 3 1643
后悔当初
后悔当初 2020-12-06 02:58
response.sendRedirect(\"../seja/izpisknjig.jsp\");

the file in which I execute this line is index.jsp. the directory structure looks like this.

3条回答
  •  庸人自扰
    2020-12-06 03:06

    Most reliable would be to create a domain-relative URL with the context path included.

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

提交回复
热议问题