Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calling JSP method from JavaScript function

843840Jul 24 2008 — edited Jul 24 2008
Hello 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 21 2008
Added on Jul 24 2008
5 comments
3,724 views