How do you pass control from one JSP page to another

Showing Answers 1 - 9 of 9 Answers

prasadraju

  • Jun 7th, 2005
 

we can forward control to aother jsp using  
jsp action tags forward or incllude 

soma

  • Jul 25th, 2005
 

Can u plz write the syntax also.Because for the beginners it is difficult like practically also one should know

  Was this answer useful?  Yes

Karthick

  • Jul 27th, 2005
 

The questions give an idea for preparing for the interview.  
 
Thanks 

  Was this answer useful?  Yes

Umesh

  • Jul 28th, 2005
 

the tags to use to redirect to the new page are as below 
 
 
 
Param tag is used with the forward and include tags in JSP it incleudes the name and the Value  
 
We can also forward the JSP from pne page to another by using the sendredirect method 
response.sendRedirect("JspName"); 
 
The differnce between the JSP forward and the sendredirect is that forward is a serverside activity . when one reqest for the forward method it works witout clients notification. i.e URL is appended in the outPutStream onlt. 
But when we call sendRedirect method it works as a new request and with clent notification it generates new page. 
But sendredirects make one extra roundtrip... so it is slower than the forward 

  Was this answer useful?  Yes

Raja Rao

  • Sep 27th, 2005
 

prasadraju Wrote: we can forward control to aother jsp using  
jsp action tags forward or incllude 

You are right in saying that JSP action tag <jsp:forward page="relativeURL" /> could be used to forward control from one jsp to another jsp but I am not sure if include action can be used. As far as my understanding goes <jsp:include page="url" /> is used to include a static, dynamic resource which gets included at the run time.

sendRedirect method of response object is another technique of forwarding the control from one jsp to another.

  Was this answer useful?  Yes

shankar

  • Jun 7th, 2006
 

hi

this is shankar...........

what are the differences b/w CGI and Servlets

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions