• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to call Servlet from Applet?  RSS feed

 
Aman Verma
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Im new to Applets.

Would anyone please tell me how to invoke servlet from a applet? I just want to execute a servlet when user will click on a button on applet.

Thanks
-Aman
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24216
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use getAppletContext().showDocument() if the servlet's output is s Web page you want to display. Otherwise, just use the java.net.URLConnection class.
 
Sean McGarvey
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a problem similar to this. When I use getAppletContext().showDocument() to invoke my servlet to produce output to be displaying in a web browser, everything works great.

The problem is that the servlet does not receive the session info from the applet. In fact, request.getSession(false) returns null.

Any suggestions? Is there an Apache setting that I need to configure?

Thanks,
Sean
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!