aspose file tools*
The moose likes Servlets and the fly likes request from Applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "request from Applet" Watch "request from Applet" New topic
Author

request from Applet

Xinyi Zhang
Ranch Hand

Joined: Apr 28, 2001
Posts: 42
Can a Applet send HTTP request? I mean it communicate with Servlet or JavaBean.
Thanks.


Xinyi
Devesh H Rao
Ranch Hand

Joined: Feb 09, 2002
Posts: 687

hi Xinyi
you can communicate with a servlet from a servlet in the following way
URL servletURL = new URL("/URL of servlet");
URLConnection oServletConnection = servletURL.openConnection();
ObjectInputStream inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
and then use the java api for ObjectInputStream to communicate with the servlet....
Devesh.
Asher Tarnopolski
Ranch Hand

Joined: Jul 28, 2001
Posts: 260
hey, if GET request is good enough for you, you don't need http tunneling.
you can use getAppletContext().showDocument(new URL("path_to_servlet");
from your applet.
enjoy.


Asher Tarnopolski
SCJP,SCWCD
Xinyi Zhang
Ranch Hand

Joined: Apr 28, 2001
Posts: 42
Thanks, Devesh and Asher. Now, Let me try.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: request from Applet
 
Similar Threads
Servlet to applet communication
Clock
WA #1.....word association
Java program protection.
Clock