File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How can I connect to a Web-site from applet/java application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How can I connect to a Web-site from applet/java application" Watch "How can I connect to a Web-site from applet/java application" New topic
Author

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

Ruilin Yang
Ranch Hand

Joined: Jan 06, 2002
Posts: 150
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
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15959
    
  19

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Ruilin Yang
Ranch Hand

Joined: Jan 06, 2002
Posts: 150
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

Joined: Jan 06, 2002
Posts: 150
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I connect to a Web-site from applet/java application
 
Similar Threads
showDocument doesn't work on IE
Connect to a web site from Applet (java application ?)
Applet connect to a web-site
JWS - A Good Way To Demo Apps
A pretty microsoft pickle