• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can I make an applet act as a server

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
If a regular clown is funny, then a larger clown would be funnier. Math. Verified by this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic