File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes How to pass JSP resultant data to javascript? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How to pass JSP resultant data to javascript?" Watch "How to pass JSP resultant data to javascript?" New topic
Author

How to pass JSP resultant data to javascript?

Kumaravadivel Subramani
Ranch Hand

Joined: Jul 05, 2008
Posts: 166

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.


No pain, No gain.
OCJP 1.6
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60994
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kumaravadivel Subramani
Ranch Hand

Joined: Jul 05, 2008
Posts: 166

Thanks for given the nice explanation with article.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to pass JSP resultant data to javascript?