This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to open a JSP page inside another JSP page?  RSS feed

 
Kishor Joshi
Ranch Hand
Posts: 674
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi there

I have two jsp page one is demo1.jsp and other is demo2.jsp

on a click of a particular link on demo1.jsp I want to opwn demo2.jsp inside demo1.jsp without changing layout of demo1.jsp

I tried to use <jsp;include />

but that doesn't work for me.

I don't have code know.But how to do this simply on a single link click on a big page?

Thanks
 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, for a start you should use a colon and not a semicolon in jsp:include.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A JSP include happens on the server before the page is even sent to the browser. You need to understand how JSP operates; please read this article to learn how JSPs work.

In order to include new elements into a page as the result of a client-side event -- such as a button or link click -- you should be using Ajax to fetch the HTML fragment (not full HTML page) from the server and insert it into the DOM. jQuery will help you do this with a single line of code.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!