Question: Difference between forward and sendRedirect in JSP?

By: Guru Singh Emailed: 1606 times Printed: 2076 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

Question: Difference between forward and sendRedirect?

Answer: When you invoke a forward request, the request is sent to another resource on the server, without the client being informed that a different resource is going to process the request. This process occurs completely with in the web container. When a sendRedirtect method is invoked, it causes the web container to return to the browser indicating that a new URL should be requested. Because the browser issues a completely new request any object that are stored as request attributes before the redirect occurs will be lost. This extra round trip a redirect is slower than forward.

 

 

 

 

Interview Home | All Interview Tutorials | Latest Interview Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(1)


1. View Comment

simple but accurate

View Tutorial          By: Githin Zacharia at 2011-08-10 06:08:32

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Guru Singh
Scrolling message on the status bar using Javascript
Diabling Right Click option in a browser using Javascript
Password protect a web page using Javascript
Using revealTrans to do page transitions in Javascript
Question: How is the MVC design pattern used in Struts framework?
Question: What is the directory structure of a web application?
Question: Explain the life-cycle methods in JSP?
Question: What is an output comment in JSP?
Question: What is a Hidden Comment in JSP?
Question: What is an Expression tag in JSP?
Question: Difference between forward and sendRedirect in JSP?

More Tutorials in Interview
What is J2EE?
What do you understand by a J2EE module?
Tell me something about J2EE component?
What are the contents of web module?
Differentiate between .ear, .jar and .war files.
What is the difference between Session Bean and Entity Bean?
Why J2EE is suitable for the development distributed multi-tiered enterprise applications?
What do you understand by a container?
What are the services provided by a container?
What are types of J2EE clients?
What is Deployment Descriptor?
What do you understand by JTA and JTS?
What is JAXP?
What is J2EE Connector architecture?
What is difference between Java Bean and Enterprise Java Bean?

More Latest News
Most Viewed Articles (in Interview )
Interview Question: How do I install Struts?
Question: What is a Hidden Comment in JSP?
What do you understand by a J2EE module?
Interview Question: How is the MVC design pattern used in Struts framework?
Interview Question: Why it is called Struts?
Interview Question: Why do we need Struts?
Interview Question: What about JSTL and JavaServer Faces ?
Interview Question: Why are some of the class and element names counter-intuitive?
Interview Question: What is EJB container?
Interview Question: What is Remote client view?
Interview Question: What is local interface. How values will be passed?
Interview Question: What is abstract schema?
Question: Difference between forward and sendRedirect in JSP?
Tell me something about J2EE component?
What are the contents of web module?
Most Emailed Articles (in Interview)
Interview Question: What is ActionServlet?
Interview Question: What is Struts?
What is J2EE?
What is Deployment Descriptor?
Interview Question: Where can I get help with Struts?
Why J2EE is suitable for the development distributed multi-tiered enterprise applications?
What do you understand by a container?
What are types of J2EE clients?
What is JAXP?
What is J2EE Connector architecture?
What is difference between Java Bean and Enterprise Java Bean?
How to define an Abstract class?
Explain garbage collection?
Interview Question: What is Action Class?
Interview Question: What is ActionForm?