Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

AJAX call function

843838May 29 2006 — edited Aug 11 2006
i have all my functions in a java class file....how do i call the function using ajax? does anyone know?
thx

Comments

843838
izzit possible to call the java function from the class file by ajax?
plz let me know if u know...
quite urgent...thx very much..
843838
the page you are calling will be the one to call the class file.. haven't tried that part yet

Message was edited by:
jgalacambra
843838
yes, its correct. oh i see.
does anyone knows how to do so?
my jsp page is server side jsp page that have ajax will POST data back to server and call the function from the java class file, after that return the processed info back to the jsp page.
843838
this reply is what i get from SitePoint forum

to call a function of the java of the server-side from java scriopt. In this case you can use
1) XMLHTTP object to invoke the JSP/ACTION/SERVLET of the server trhough client side.
2) pass the value to that request.
3) get the response and dispaly it on the page.

any idea on that?
843838
Have you considered using DWR for your AJAX calls. It's a very simple open source framework for implementing AJAX into your Java Web application. One of the benefits of using DWR is easy browser compatibility, the framework will generate most of the client side javascript for you, all you have to do is define your java classes in the dwr.xml, and define the dwr servlet in your web.xml.

I highly recommend using DWR for your AJAX calls.

http://getahead.ltd.uk/dwr/overview/dwr
800487
The procedure to send a request and process the response is explained in Ajax tutorial.
http://www.regdeveloper.co.uk/2006/06/09/ajax_web_tutorial/
http://www.regdeveloper.co.uk/2006/06/20/ajax_web_tutorial_part2/
1 - 6
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 8 2006
Added on May 29 2006
6 comments
82 views