File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Java 8 in Action this week in the Java 8 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: 1506
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
Can we pass parameters from a Javascript function to an XSL file
Tapestry 5: how to set and get response attribute from javaClass to htmlJavascript ?
calling javascript function from ActionScript Method
URL Masking
How to use the Java variable inside the Javascript function