Hello Roger,

There was a lot of discussion about this just recently.  I think the
"easiest" way to accomplish what you want is a browser-driven query of the
messages on the server through JavaScript timer function.  Applets create
all sorts of problems, from not being able to run in certain browsers, to
being too heavy to load on your light(?) client.  And as you mentioned, you
must also make it invisible.  

 If your applet does other things in your client scheme, I would _maybe_
say, go with the applet-based communication.  But I would not have the
applet just for communication with the server. 

IMHO, JavaScript approach works in 95% of these cases and can be slapped
together in just a couple of hours.  (Unless you visit these boards
frequently, of course!! :-))

Good luck!

Greg



-----Original Message-----
From: Roger Adema [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 2:38 PM
To: JDJList
Subject: [jdjlist] Pushing data to a browser


Hello, everyone -

I have a question that isn't strictly Java-related, but there seems to be a
lot of knowledgeable people that subscribe to this mailing list. so I'm
hoping someone can point me in the right direction.  I know I run the risk
of having several people point me in different directions, but I'm willing
to take that risk (having several alternatives to choose from is way better
than having no alternatives :-)).  I am pretty new to web application
programming in general, so I won't be surprised at all if this problem can
be solved in a standard, straightforward way - I just haven't stumbled onto
it yet.

I am trying to webify a legacy app and I need to solve the problem where
the application may need to send unsolicited data to the "display" (which
is actually represented by a browser).  The problem I'm running into is
that I need to push this data to the browser when it doesn't know it's
coming.  The best way I can think of solving this is to have an applet
running in an invisible frame that opens a socket to which a servlet on the
web server sends some sort of "refresh" notification when the unsolicited
data is available, and then have the applet use the Java-JavaScript
interface to cause the browser to ask for a refreshed web page.

Are there other, better approaches?  What are the gotcha's in the approach
outlined above?  Any help is much appreciated.

Regards,
Roger



To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm

Reply via email to