473,385 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 8502
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: StealthMonkey | last post by:
Let me prefix this by saying that I know next to nothing about Java (so please try to keep explainations simple). I use PHP for my server-side web programming. Here is my dilemma: I need a...
2
by: Rose Girl | last post by:
Hi Need some help on javascript. I need to know how to call a servlet from a javascript function. web-inf (jboss) path for servlet is: com.purpleace.ripple.admin.contacts.servlet.AdminReport...
9
by: misdst23 | last post by:
Hi, I know I can call a static java method within javascript by using the <% ... %tags. But how can pass a javascript variable ? function thefunction() { var = javascriptvariable ;
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
0
by: TraceyAnnison | last post by:
I wonder if you can help me - I'm new to this, and working in a project that has already been configured to work with Axis. We have a Java project built with the Spring framework, in order to...
6
by: moongeegee | last post by:
I have compile my java program as myjava.class. And I can run as "java myjava" without any program. As now, I need to execute myjava.class in javascript. Please shed a light how to execut "java...
3
dmjpro
by: dmjpro | last post by:
Have a look at my problem. try{ //String tokenLocatorUrl = "http://erp.iitkgp.ernet.in:80/SSO_Token_Object_locator/resources/getSSOToken"; String tokenLocatorUrl...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.