Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what is codebase in applet ?

Status
Not open for further replies.

WebGoat

MIS
Jul 16, 2005
85
US
Hi,
what is codebase in applet tag ?
some applet use this attribute , some dont.
what is this codebase ?

can you please provide an example ?

thank you
 
CODEBASE URL

the base URL of the applet; this typically refers to the directory or folder containing the code of the applet

URL to what ?

say,
i have a dir structure in tomcat

webapps/myapps/WEB-INF/classes/com/abc/def

i have put my applet in myapps directory in tomcat.

so what is codebase now ?

definition says "refers to the directory or folder containing the code of the applet".

SO THE CODEBASE IS myapplet

is this correct ?







if suppose, the Applet class useues a package and is put under /myapps/WEB-INF/classes/com/abc/def directory

what is the CODEBASE NOW ?
 
You should not put Applets in the WEB-INF classes directory - as these are classes used by Tomcat - whereas Applets are not available, or anything to do with, the Tomcat engine.

So you should put the applets in a jar file, and put them, for example, here :

webapps/MyWebApp/my_applets.jar .

Then your codebase URL will be :


--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
So you should put the applets in a jar file, and put them, for example, here :

webapps/MyWebApp/my_applets.jar .

Then your codebase URL will be :


and what will be the code now in the Applet tag? is this the fully qualified class name ?


your solution is good.but it has one problem

You told not to keep the Applet in the WEB-INF/classes/blah/blah directory. but if i dont do it anybody can download my applet !! can i stop downloading by the user ? or it is the destiny ?
 
Humm

How did you expect people to run your applet without downloading it?

Cheers,
Dian
 
LMAO, the point of putting your applet in a directory where it can be downloaded is .... wait for it .... so people can download it !

To use in a jar :

<applet codebase="/MyWebApp" class="classname.class" archive="my_applet.jar"/>

or something like that - have a play around with the parameters if that doesn't work :
--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
class="classname.class" this should have been Fully qualified classname . right ?

for example, if the Applet class is in a package com.web.net

so code="com.web.net.MyApplet" class

is this correct ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top