• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

How to open a JSP page inside another JSP page?

 
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
 
Marshal
Posts: 24594
55
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.
 
Sheriff
Posts: 67269
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!