This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes JSP and the fly likes is there any funtion in jsp like server.transfer in asp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "is there any funtion in jsp like server.transfer in asp" Watch "is there any funtion in jsp like server.transfer in asp" New topic
Author

is there any funtion in jsp like server.transfer in asp

Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 759
Is there any function in jsp by which i can achieve the following functionality ???

Server.Transfer ends execution of the current asp page without clearing the output. The new page has access to same set objects (Application, Request, Response, Server, Session) as the starting file. To the browser it will appear you have the originally requested page not the page to which you are transferred.


Jigar Naik


Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Yes, we have <jsp:forward ../>
http://java.sun.com/products/jsp/tags/11/syntaxref11.fm9.html


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 759
Originally posted by Jigar Naik:
without clearing the output.


in the case of forward the output of the source .jsp won't get displaied.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

That is correct. If you wan tto mix output from multiple sources, you'll beed to use an include.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 759
but in my case, i have got 2 jsp, (view1.jsp & view2.jsp) from view1.jsp i need to forward request to view2.jsp and i dont have access to modify code of view2.jsp so i can't code include directive in view2.jsp

any alternative ??? without altering view2.jsp ???
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

If part of the output is from the first JSP and part from the 2nd, why would there be any difference between a forward and an include?

And if these are both part of the same web app, how can you not be able to modify the second JSP?

Incidentally, it sounds as if this whole thing is a fragile deck of cards that's going to come crashing down sooner rather than later. What's preventing you from structuring this in a reasonable fashion?
Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 759
i dont know how the application is structured, but what i posted is what my seniour told me.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: is there any funtion in jsp like server.transfer in asp