• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to populate a jsp inside a jsp

 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using jsp tag libs and have a requirement that on click of an image button that button should be replaced by a separate jsp which is included in current jsp
and with in same page contents of that jsp should come
but I am facing problem as how can I invoke <jsp:include> directive on click of a button
Can any one pls give me suggestion?
Thanks in advance
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about using IFrames?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

but I am facing problem as how can I invoke <jsp:include> directive on click of a button


You can't - the button is on the user side and jsp:include is on the server side.
Perhaps you can keep the included jsp output invisible until the button is clicked using JavaScript.
Bill
[ September 25, 2004: Message edited by: William Brogden ]
 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i got the answer we have to refresh jsp on click of button and while refreshing it we put some flag which if true can allow the jsp:include to become active
correct me if i am mwrong
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd bet you could figure out doing it that way. You might also be able to figure out how to do it on the client side with JavaScript and/or DHTML.
 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The method you have thought is correct one. Use the flag to include another JSP.
Another method, to include the JSP content at the very start when this page is loaded, but keep in a hidden div. You can show these contents on the click of that button.

but the first method appears better if the contents/processing on server side for the included JSP is heavy. If it is very small, send one is better, it will aviod the network traffic.
 
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic