Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Send redirect to relative path in JSP?

response.sendRedirect("../seja/izpisknjig.jsp");

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

How do I form the relative path to redirect to izpisknjig.jsp.

like image 888
Borut Flis Avatar asked Jun 07 '12 21:06

Borut Flis


1 Answers

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

response.sendRedirect(request.getContextPath() + "/seja/izpisknjig.jsp");
like image 92
BalusC Avatar answered Jan 04 '23 08:01

BalusC