Calling JSP method from JavaScript function
843840Jul 24 2008 — edited Jul 24 2008Hello Everybody,
I have written one JavaScript function in my JSP page. I am calling this JavaScript function on selection of one dropdown list.
I want to writting some JSP code in this JavaScript function. I have written following code to set the value in session.
function storeLanguage()
{
var l_language = window.event.srcElement;
if(l_language != null)
{
alert("Selected Language: "+l_language.value);
<%componentRequest.getComponentSession().putValue("localeLanguage","de");%>
}
}
I am setting locale value using putValue() method of Component session. Right now, I have set default value as "de" in this method.
But, what I want is, I want to pass l_language.value in putValue() methods to set this value in session.
Can you please let me know how can I pass this value? I am really a new person in JSP. I was working on JSP in my gratuation time and not after that.
Regards,
Bhavik