Java String to html var
So i have a scriptlet that does some stuff and ends with a String called results. Within the scriptlet I do
I need to access the String results outside of the scriptlet, to perform some action in the html portion of the page with it. So after the scriptlet I have
var word = '<% session.getAttribute("result"); %>'
This however gives me a blank string or undefined, I tested doing alert(word). I have also tried some of the following
var word = '<% StringFormat.toHTMLString((String) session.getAttribute("result")); %>'
var word = '<%= with session.get and stringformat.toHTML %>'
I guess the problem is the formating difference from java string to html's var format. How do I do this?
what you exactly want to do?
you want to put the java var value to a html form var value? or what?
please clear your query