Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

How can I connect to a Web-site from applet/java application

 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can I use an applet to connect to a web site with the applet's method: showDocument (siteURL) ?
How can I connect to a site from a Java Swing application ? Are there some methods similar to the above showDocument (siteURL) ?
After connected to the web site I would like to get into my account in the web-site to do some operations as if I am accessing the site directly.
Please help me ?
Thanks
Ruilin
 
Saloon Keeper
Posts: 24555
168
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not ShowDocument, no. You can have an applet act as a sort of mini-browser by using the HttpURLConnection class to send data in the form of HTTP requests to the web server and receive HTTP data back.
HTTP servers aren't like remote terminal servers or LAN servers where you can just "log in" and do what you like. All you can do is make requests and get responses to those requests.
 
Ruilin Yang
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim,
Thanks,
I do not need to get object or XML files from servlet by using Applet. I like to connect to a web-site from an applet. If I can do this I would be able to surf on another site from within my applet or a java swing application.
I know how I can communicate with servlet to get/send serialized objects or XML.
Thanks again
Ruilin
 
Ruilin Yang
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim,
It seems you are right: "HTTP servers aren't like remote terminal servers or LAN servers where you can just "log in" and do what you like. All you can do is make requests and get responses to those requests."
The only way to surf another site is to do it with a html page with a link.
Am I correct ? Please comment.
Thanks
Ruilin
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic