This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, I want to be able to update my web page with data coming every second from some server over HTTP post. Currently I have a listener program that is recieving data constantly. But can I make an applet that acts as listener on a particular port and recieves data over HTTP Post. This way I can update my web page in dynamically in real time. Thanks Ritu
Hi Ritukama, Before you catch some heat from one of the bartenders or sheriffs around here, you need to change your display name to a first and last name. Now, as you know, under most circumstances, an applet runs in the "sandbox". Unless the local machine has a policy file in place for the applet's codebase (or signed certificate) granting extra privaleges, then the applet can only access ports (and other resources as well) on the machine that it originated on (the codebase.) I'm not totally clear on what you are trying to do, but most likely the answer to your question is no you can't listen on ports from an applet without explicit permission being granted. Hope this helps Michael Morris SCJP2 [ April 02, 2002: Message edited by: Michael Morris ]
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Joined: Sep 10, 2001
Hi Michael, I fixed the name problem - thanks for reminding me. I got the idea that applets cannot access resources outside the codebase. What I am trying to do is as follows: I have a server that is sending some data (in XML format) over HTTP post and I need to be able to display the data in real time in a browser. I was looking for a way to implement this without having to refresh my web page over and over again. Do you have any idea? Thanks Ritu
Joined: Jan 30, 2002
Hi Ritu, If your web server supports JSP and servlets, that's probably your best option. I have very limited experience in those areas so I would suggest you post this on the JSP and/or servlets forums here at JavaRanch. Hope this helps Michael Morris SCJP2