• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing parameters to Applets

 
YanJun Tong
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an Applets whose parameters are highly depending on what the user selected. Thus my applet needs to get parameters from its host html.
For instance generally we put an applet in html in this way
<applet
codebase = "."
code = "com.catania.web.misc.BodyDiagram.class"
name = "TestApplet"
width = "352"
height = "432"
hspace = "0"
vspace = "0"
align = "middle"
>
<param name="color" value="red"/>
<param name="line" value="withoutLine"/>
But since my parameters are dynamic, how to change the above codes?
Thanks
 
Joe Ess
Bartender
Posts: 9340
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use a Java Server Page (JSP) rather than a static HTML page. You can then have some server-side logic to determine the parameters on-the-fly.
 
YanJun Tong
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joe thanks for your reply. My story likes this;
The Applet is called BodyDiagram.class it is in the com.catania.web.misc package. And all my file is under the f:/app folder i.e. the path of the BodyDiagram.class is f:/app/com/catania/web/misc/BodyDiagram.class

My jps file is under the f:/app folder. In my jsp file I put the applet in this way
<applet
codebase = "."
code = "com.catania.web.misc.BodyDiagram.class"
name = "TestApplet"
width = "352"
height = "432"
hspace = "0"
vspace = "0"
align = "middle"
>
But it does not seem to wrok

Could you please help me out, thanks in advance.
 
Joe Ess
Bartender
Posts: 9340
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WHAT doesn't work? What app server are you using? Are you getting an error or exception? What browser are you using to view the applet?
 
YanJun Tong
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The functionality of my Applet is to show some image. By the term "does not work" I mean the image can not be shown.
I use MS Ie as my browser,Tomcat as server.
Thanks
 
Joe Ess
Bartender
Posts: 9340
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using the default Microsoft VM or the Java Plug-In? Have you tried looking at the java console to see if the applet gets loaded or if there's a stack trace from an exception?
 
Paul Smiley
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure that you're not trying to get the Applet parameters from within the Applet constructor...
[ September 09, 2004: Message edited by: Paul Smiley ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic