File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes servlet applet communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet applet communication" Watch "servlet applet communication" New topic

servlet applet communication

Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
what are the ways by which applet and servlet can communicate?
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
u can communicate with a servlet from an applet by,
1.calling the servlet URL using showDocument method of applet context.(pass servlet URL as param)
2.Another way is to open a connection to servlet using URLConnection reference.
URL url=new URL("servlet url here");
URLConnection uc=url.openConnection();
i think this will work.
u have to prepare the query string yourself if u want to send some values in applet to servlet .
try them.
I agree. Here's the link:
subject: servlet applet communication
It's not a secret anymore!