hi,
I understand that you want to call a java function from javascript. This is
possible only in applets and using the live-connect technology. However this
is buggy and difficult to debug.
To call a function inside a jsp page from a javascript function in the same
page is not possible. The jsp part is executed in the server and only the
output is sent to the browser. The javascript part works only after the
html output has been loaded.
To send the user events to the server, one can give something like this
<a href="/servlet/MyServlet?event=name_of_event">link text </a>
The servlet can then use request.getParmeter("event") and then forward the
request to an appropriate jsp page.
Regards,
Nagarajan.
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of David Gee (MAYA Design)
Sent: Wednesday, September 19, 2001 5:06 PM
To: [EMAIL PROTECTED]
Subject: Dynamic HTML/Javascript & JSP
I'm looking for some resources on using DHTML/JavaScript with JSP.
What I'm trying to do is call a method from a javascript event handler, ie:
<a href="#" onClick="someFunction()">LINK TEXT</a>
where someFunction calls the Java method.
here is some example code of what I have right now:
<%@ page info="Portal Page"
import="com.maya.harness.SomeBean"%>
.
.
.
SomeBean somebean = (SomeBean)session.getAttribute("somebean");
somebean.doMethod("parameter");
.
.
.
what I'm trying to do is tie somebean.doMethod into a user event handler.
any ideas?
david
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets