• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to include jsp from javascript

 
Satyajit Bhadange
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

i have this requirement wherein i want to include jsp on button click event..

i know that included jsp's are part of whole jsp...so including jsp at runtime is not possible..

but is it possible to create DIV and include jsp in that at runtime...

or some other way where i can include jsp dynamically...

even if this can be achieved using iframe..i cant use iframe in my module...please help me with this problem
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65529
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use Ajax to fetch the results of running a JSP and place the results into the DOM.
 
Pravin Shirke
Ranch Hand
Posts: 152
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi satyajit,
create an xmlhttprequest object and then call you jsp from your xmlhttprequest objects. open method and pass an url. where url is your jsp name ok

hope it helps. for code help a simple google of xmlhttprequest and jsp might help you.
 
Satyajit Bhadange
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply..i will try
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!