Bookmark Topic Watch Topic
  • New Topic

How to pass value from Java to JavaScript

 
Ruta Kulkarni
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
I would like to know is it possible to pass value from Java to JavaScript.

I have called REST Web service which will return me the JSON Array response in Java, I want to pass this response to JavaScript. I can parse the response form JavaScript and can display it from HTML.

Please let me know if there is any possible way for it.

Thanks in advance.



 
Kishore Tulsiani
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Report post to moderator
what I can say is from java you can store the value in request and from request you can take that value and store it in hidden element on HTML. once you got the value in hidden element it can be easily accessible in java script

sample code

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65120
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Not directly. This question has been asked many times and has an entry n the JspFaq.

Please SearchFirst.
 
    Bookmark Topic Watch Topic
  • New Topic