DEVFYI - Developer Resource - FYI

How do I perform browser redirection from a JSP page?

JSP Interview Questions and Answers


(Continued from previous question...)

26. How do I perform browser redirection from a JSP page?

You can use the response implicit object to redirect the browser to a different resource, as:
response.sendRedirect("http://www.exforsys.com/path/error.html");
You can also physically alter the Location HTTP header attribute, as shown below:
You can also use the:
Also note that you can only use this before any output has been sent to the client. I beleve this is the case with the response.sendRedirect() method as well. If you want to pass any paramateres then you can pass using >

(Continued on next question...)

Other Interview Questions