Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to pass JSP resultant data to javascript?

 
Kumaravadivel Subramani
Ranch Hand
Posts: 171
Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to All,
Actually I'm trying to call a JSP from javascript and wanna to get some data from it. This JSP will read some file and return data, this data has to be passed back to javascript so that I'll would be populating another html page form fields.

I've created JSP file to read file and displayed in new window by calling javascript function through window.open but instead of displaying the data in browser window want to have it in javascript variable.

Kindly help me out this.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow. You shouldn't have resultsets in a JSP at all -- nor any Java code.

In any case, remember that JavaScript executes on the client and JSP on the server, so they cannot interact directly. Please read this article for an explanation of how JSP works.

You might also find this article useful for properly structuring a web app.
 
Kumaravadivel Subramani
Ranch Hand
Posts: 171
Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for given the nice explanation with article.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic