In ASP, you can do "remote scripting" where a client-side javascript
function calls a server-side function and get values returned.  I believe
this was done thru a Java-app.  And it did not refresh or re-submit the
page, the returned value coule be put in a div.innerHtml tag.

Does any JSP web-servers offer similar functionality?

an ASP reference is here: http://msdn.microsoft.com/scripting/

thanks,
Chris E

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Jim Preston
Sent: Wednesday, July 19, 2000 10:23 AM
To: [EMAIL PROTECTED]
Subject: Re: Calling a Java method from onclick event


As I've said before, the Java part of a JSP lives on the server and is
executed at page-request time. JavaScript lives on the browser and the
"onClick" function is executed strictly on the browser when the user clicks
on that element. What happens with your code below is that the
getCriteriaInd *Java* method is executed *once* when the page is served, the
output of that method is dropped into the HTML -- in this case as the
parameter to the JavaScript function callHtml -- and from then on is
hard-coded as far as JavaScript is concerned. You can easily see this by
accessing your JSP and then doing a "view source" from the browser to see
that your call to callHtml just has some string as the parameter; the JSP
"<%=" tag has been replaced and lives no more.

(I knew that Sun naming it JavaScript was a mistake and would lead to
endless confusion with Java. Now with JSPs mixing Java and JavaScript, the
confusion is going to increase exponentially...)

--Jim Preston


-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of kavitha ramasamy
Sent: Tuesday, July 18, 2000 7:46 AM
To: [EMAIL PROTECTED]
Subject: Calling a Java method from onclick event


Hello,

   I need to include a java method in OnClick event of the method.
But that method is called only first time when the JSP page is loaded.
It is not calling whenever I click that button.

  When I am clicking the button, I need to get some value from the methos
depends on that value, button click action is handled.
  I dont want to refresh my page on the click especially.
This is the sample how I am calling the java method to get that value.

          <td width="15%" align="center"><input type="button" name="Submit4"
onClick="callHtml('<%= critInd.getCriteriaInd(leadlistnum) %>')"
value="SetCriteria"></td>

KavithA
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
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".
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".
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

Reply via email to