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.
You may be overthinking this. You could just pier some generate some javascript to redirect anywhere you like.
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 :
Most reliable would be to create a domain-relative URL with the context path included.