Discussion:
Calling java mthod from button onClick method
(too old to reply)
yfreife
2005-08-09 13:50:54 UTC
Permalink
Hi
I am trying to call java class method from button onClick method.

<input type=button name="RunUpgrade" value="Run Upgrade"
onClick=<%requester.Start();%>

Thanks in advance,
Yariv
Andrew Thompson
2005-08-09 13:56:38 UTC
Permalink
Post by yfreife
I am trying to call java class method from button onClick method.
In a web page? URL?
(upload it all to a free site, even broken, and
people can help much quicker)
--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
Beats A Hard Kick In The Face
yfreife
2005-08-09 14:07:21 UTC
Permalink
hi
sorry,
i forgot to say that it is jsp file which has button and when it is
pressed by user it should call
java class' method
when i used the following line:
<input type=button name="RunUpgrade" value="Run Upgrade"
onClick=<%requester.Start();%>
the procedure started when the page is loaded...

BTW, i am coding in java\jsp\html for one month, so please be patient
:)

thanks in advance,
yfreife
Tor Iver Wilhelmsen
2005-08-09 15:11:48 UTC
Permalink
Post by yfreife
the procedure started when the page is loaded...
Yes, the JSP runs on the server, the content is transmitted to the
browser. At that point the Java code has finished. The browser does
not "see" the JSP code.
Andrew Thompson
2005-08-09 14:56:19 UTC
Permalink
Post by Tor Iver Wilhelmsen
Post by yfreife
the procedure started when the page is loaded...
Yes, the JSP runs on the server, the content is transmitted to the
browser. At that point the Java code has finished. The browser does
not "see" the JSP code.
Is that what you meant by '..trying to call java class method
from button onClick method.'?

I thought you were talking about an applet.

No, you cannot call a method/class in your JSP from
JavaScript, not directly, like I guess you mean.

What is it you are actually trying to do for your
user? There may be better ways.
--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
Filmed on Location
Loading...