aspose file tools*
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 Spring in Action this week in the Spring 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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: passing a html/javascript parameter into a java function