applet question

I would like to load an applet from the jsp page.
I have me code like this.

I have my class file in the .jar folder
I have my applet code in the jsp page like this
<applet code="XXXX.class" width=300 height=250 archive=XXYY.jar>
....
....
<params>
....
....
</applet code>
=================
The .jar has the applet class. The page is loading fine...but not the applet. How to I load the applet in the page.

winsuncareerAsked:
Who is Participating?
 
arun_kuttzCommented:
is your jar placed in the <your-web-app>/WEB-INF/classes/ or <your-web-app>/WEB-INF/jar/dir ???
The browser will not be able to access the archive if its placed within the WEB-INF dir...

create a dir ->
<your-web-app>/applets

place XXYY.jar into the dir

now modify the code as follows :

<applet code="XXXX.class" width=300 height=250 archive="/applets/XXYY.jar">
....
....
<params>
....
....
</applet code>


let me kno if it works..

-KuTtZ
0
 
arun_kuttzCommented:
or... u might try something like :

<applet code="XXXX.class" width=300 height=250 codebase="/applets" archive="XXYY.jar">

-KuTtZ
0
 
winsuncareerAuthor Commented:
I have the .jar in my build directory.
The path for applet class in the jar is ....
/com/dtc/actualfolder/src/applets/XXXX.class

================
How do I do this? comment from-KuTtZ
=======================
                               create a dir ->
                                     <your-web-app>/applets

                                place XXYY.jar into the dir
0
 
arun_kuttzCommented:
what i meant was, the jar should NOT be inside the WEB-INF directory.
basically.. what u must do is create a directory in the SAME HIERARCHICAL level as the WEB-INF dir like so -->

 |---/WEB-INF
 |          |
 |          |--/classes
 |             ...........
 |---/applets       <--------- u create the directory here

and place the jar inside it...



-KuTtZ
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=23&t=003923

http://www.htmlcodetutorial.com/applets/_APPLET_CODEBASE.html

check this out.

i think it must be

<applet code="XXXX.class" width=300 height=250 codebase="../applets" archive="XXYY.jar">

and make sure your class name is correct (i.e Upper case & lowercase stuff).
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.