Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I launch an Applet/Application from a Servlet?  RSS feed

 
AltheaLS
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:
I am new to servlet technolygy. How can I launch an applet/application from a servlet? I saw the following code snippet
out.println(<"APPLET CODE=Foo.class CODEBASE=/applets WIDTH=400 HEIGHT=400"> ;
In the servlet class, will this be the only line of code there? What else would I need to do? If an application, where would I put the appletviewer statement?
Your help is appreciated!
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main thing to remember is that servlets typically write HTML pages, so anything you might do with an applet in a static HTML page can be done through a servlet generated page. The servlet has to generate the complete page so you will certainly be writing more code than just the one line.
Bill
 
Aleksey Matiychenko
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you do not need appletviewer statement. Appletviewer is just a tool for testing an applet.
You do need to produce a right HTML code. If you use swing in your appltes you need to have java plugin installed and you need to create a right html (could be produced by HTML Converter) in you servlet.
 
AltheaLS
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I appreciate your quick responses!
However, it did not help me, because I did not understand what you meant. I'm just now going through the moreservlets text by Marty Hall, and am at chapter 3. I do not yet have any in-depth knowledge of servlets, or how to implement any of the things you suggested. Can someone please be a bit more specific, with a dummy code if possible? Thanks very much!
 
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!