Send redirect to relative path in JSP?

前端 未结 3 1625
后悔当初
后悔当初 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:01

    You can use JSP taglib to do redirection.

    Content of index.jsp file :

    
    

    If project and seja are at root of your webapp context ( ie. http://host:port/context/project )

    Content of index.jsp file :

    
    

提交回复
热议问题