Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP to JSP

 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
can anybody tell me how do I call one JSP from another JSP ?

regards,
S
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
S Majumder
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On button click how could we call one JSP from another JSP ?

Thanks,
S
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic