469,323 Members | 1,575 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

calling a java servlet from javascript

i've got a progress bar that tracks a process running on
a server (java servlet).

i know i can refresh the page and update the status...but
this results in the page being redrawn everytime.

is there a way i can call a servlet from javascript and
process the results directly - and in this case get the
percent done and then update the progress bar.

the servlet would just return an integer.
Oct 26 '05 #1
3 8345
"ppcguy" <go*****@hehe.com> wrote in message
news:cP**************@news-wrt-01.rdc-nyc.rr.com...
i've got a progress bar that tracks a process running on
a server (java servlet).

i know i can refresh the page and update the status...but
this results in the page being redrawn everytime.

is there a way i can call a servlet from javascript and
process the results directly - and in this case get the
percent done and then update the progress bar.

the servlet would just return an integer.


The concept you're looking for have been given the fancy
acronym: AJAX.

Its just a way of saying: Use the old traditional method
of calling the servlet from a hidden <ifame>, and update the
opener.xxx on return, or...

....use the XmlHttpObject and set up a response callback.

Google for AJAX, or start here:
http://www.ajaxmatters.com/r/welcome

--
Dag.
Oct 26 '05 #2
On Wed, 26 Oct 2005 00:09:44 +0000, ppcguy wrote:
i've got a progress bar that tracks a process running on a server (java
servlet).

i know i can refresh the page and update the status...but this results in
the page being redrawn everytime.

is there a way i can call a servlet from javascript and process the
results directly - and in this case get the percent done and then update
the progress bar.

the servlet would just return an integer.


You can use XmlHttpRequest and DOM Manipulation for this. The buzzword is
AJAX.

Sincerely,
Joachim

Oct 26 '05 #3
Embed an applet class into your html can also achieve this, but xmlhttp
& javascript is still the hottest solution...

Sincerely,

Tien-Chih Wang
----
Meta Job search Engine
http://www.onsofts.com/deepJobSearch.jsp

Oct 26 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by StealthMonkey | last post: by
2 posts views Thread by Rose Girl | last post: by
9 posts views Thread by misdst23 | last post: by
6 posts views Thread by moongeegee | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.