Hi Java People,

I have one servlet , few JAVASCRIPTS, one JSP page.

First when I login some processing is done at back in servlet and some variables are set. after login i enter into main JSP page which contains some BUTTONS. On click of every button I have some JAVASCRIPT calling. Till this stage my work is running fine...........Problem starts now........ that I want to get values in JAVASCRIPT files, which are set in Servlet...........So just tell me how to get information fron there.....

waiting for reply.........


11 Years
Discussion Span
Last Post by jwenting

I have simple question.........I want to get values of variables in JAVASCRIPT file....value of those variables are set in servlet. So how to get value in SCRIPT from servlet............Do u get it now


do you have any grasp of how Servlets and JSP work, where what is executed and when?

And there's no need to be so agressive, it's not going to make people more eager to help you.


If the value has been set, use scriptlet to access your PageContext to get the value and then set it in your Javascript block.


no, you don't use scriptlets. Scriptlets are evil and are still allowed ONLY for backwards compatibility reasons.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.