Alternatively you can decide to replace all line breaks with <br>, the HTML code for line break.
We can use it to construct the java script code in the servlet/jsp, but not within a java script once the response comes back to the browser...
so i meant use the java variable to construct the java script variable...
We can use a java variable within a scriptlet in a java script
If you have any doubts that it cannot be used, you can execute the above example. (see the source of the generated page)
once response comes back to the browser its static code.
I think we both seem to say the same thing.. probably my statement was a bit confusing.. but the initial piece of code posted which has a problem will definetly not work (as the error message is very obvious), it is not able to find the variable temp as its very much visible not created in the scriplet... (or rather, not generated)