• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Did Steve tell you that? Fuh - Steve. Just look at this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic