473,382 Members | 1,445 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,382 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 8501
"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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.