Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can I make an applet act as a server

 
Ritu Kama
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Ritu Kama
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic