This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes passing a html/javascript parameter into a java function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "passing a html/javascript parameter into a java function" Watch "passing a html/javascript parameter into a java function" New topic
Author

passing a html/javascript parameter into a java function

Claudia Vaz
Ranch Hand

Joined: Nov 13, 2001
Posts: 44
Hello
I have a html input parameter. When i do the "OnChange" i call a javascript function that calls a Java function.
My problem is that i want to pass the html parameter to the java functio. How can i do this?
Thanks
Claudia Vaz
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Assuming you are using servlets or JSP, you can use the httpRequests getParameter and getParameterValues methods.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Kishore Dandu
Ranch Hand

Joined: Jul 10, 2001
Posts: 1934
To my knowledge you have to do a submit so that this is propagated to the java function on the server side.
Client has knowledge about server. Server has no idea about the html parameter until it is submitted.
Hope this clarifies.


Kishore
SCJP, blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing a html/javascript parameter into a java function
 
Similar Threads
Tapestry 5: how to set and get response attribute from javaClass to htmlJavascript ?
calling javascript function from ActionScript Method
How to use the Java variable inside the Javascript function
URL Masking
Can we pass parameters from a Javascript function to an XSL file