Nalini Nagarathinam wrote:Hi,
I am having the JSP which contains the javascript, i would like to pass the variable of JS to Java method.
How to calll the java method from JS?
Thanks in advance.
Hi Nalini,
You can pass the variable of the javascript to JSP by appending the variable and its value as a
queryString to the URL eg:http://URL&javascriptVariable=value. that you are using to submit to the class where you want to access the variable in the method.However you need to have access to the request object in the method where you want to access the variable like request.getParameter("javascriptVariable")
This might be one of the approches.
Hopes this helps
Aruna.