aspose file tools*
The moose likes JSP and the fly likes JSP to JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP to JSP" Watch "JSP to JSP" New topic
Author

JSP to JSP

S Majumder
Ranch Hand

Joined: Jun 03, 2009
Posts: 244
Hi all,
can anybody tell me how do I call one JSP from another JSP ?

regards,
S
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61610
    
  67

If by "call" you mean to link them together, then just use the URL of one JSP in an anchor tag. If by "call" you mean something else, you will have to explain what that something else is.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
S Majumder
Ranch Hand

Joined: Jun 03, 2009
Posts: 244
On button click how could we call one JSP from another JSP ?

Thanks,
S
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61610
    
  67

Technically, you don't. Remember that after the JSP executes, the generated HTML page is what is sent to the browser, not the JSP.

So the question comes down to, how would you do this in HTML? So the answer to your question really has nothing at all to do with JSP. It's just an HTML and JavaScript question.

Does that give you the answer?
S Majumder
Ranch Hand

Joined: Jun 03, 2009
Posts: 244
Thanks Bear Bibeault , for your valuable reply ,
but can we do this by using request.sendRedirect () or requestDispatcher's forward()/ include() methods ?


regards,
S
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61610
    
  67

s begri wrote:but can we do this by using request.sendRedirect () or requestDispatcher's forward()/ include() methods ?

Of course not. Those are server-side Java methods. As I said, once the page gets sent to the browser, all JSP-ness is gone. At the browser, it's just HTML.

I think you need to read this article to understand what JSP is.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP to JSP