Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatically redirect from one JSP page to Another

Tags:

java

jsp

Is it possible to redirect a user automatically to a second jsp page as soon as the home page loads?

like image 578
IceNine Avatar asked Sep 02 '13 15:09

IceNine


People also ask

How do I redirect from one page to another in JSP?

The page redirect is used to move the redirect response to another resource of the web page. Basically we can call the redirect pages using sendRedirect() method in the jsp on client-side request can be used within the server or outside of the server.

How can I call one JSP page to another JSP?

To include JSP in another JSP file, we will use <jsp:include /> tag. It has a attribute page which contains name of the JSP file.

How can we forward the request from JSP page to the servlet?

Full Stack Java developer - Java + JSP + Restful WS + SpringThe forward action terminates the action of the current page and forwards the request to another resource such as a static page, another JSP page, or a Java Servlet.

What is the difference between forward and redirect?

In a standard forward, the person forwarding the message appears to be the sender. In a redirection, the message appears to come from the original sender. For example, if [email protected] receives a message from [email protected], and Bob forwards it to his colleague [email protected], it appears to Fred as a forward from Bob.


1 Answers

With core JSTL libraries loaded <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> you can use:

<c:redirect url="/home.html"/>
like image 151
JohnMark13 Avatar answered Sep 22 '22 13:09

JohnMark13