I am using first time Applet, as test Applet it was working fine.
But When I Run Actual Applet File with my Application Structure It is giving ClassNot Found Error.
-The Applet Class is in the package "com.sp.utility" i.e , rootfolder/WEB-INF/classes/com/sp/utility/ -My Applet class file Name is DescWin.class
-My HTML file which is calling Applet is in
So Please Tell me how my APPLET Tag should be in HTML file so that it can Solve my Error Please Help Me out
Nothing that is inside of WEB-INF will ever be served to to a client. You need to move all files (.class and .jar) that relate to the applet into a publicly accessible directory. It's easiest to put those into the same directory as the HTML file containing the applet tag.
Thank You For Your Reply Sir,
I can not Move the Applet class file because it depends some more classes and in one of my file my database connectivity is also present so instead of moving my Applet class file , Can i include the path in APPLET Tag,how can i do that please tell me
If i am not Wrong WEB-INF/classes is publicly accessible so i kept my applet class with other clasess in that.
What else can be done instead of moving so that Applet class is accessible form the package com.sp.utility itself ?
Thank You for correcting me. I was in wrong Thinking thank you once again.
Suppose that if i move my Applet classes to main folder where my Html page is located which is calling Applet then, How can i include or import other classes which are in com.sp.utility package simply by import command in my applet file or anything else i have to do?
If that's a hierarchy of loose class files then you can just put them in that directory as well, and the JRE will find them. But you really should package your class files in a jar file - it's much faster to load. Any jar files you have need to be listed in the archive attribute of the applet tag. See http://java.sun.com/docs/books/tutorial/deployment/applet/html.html for details.
all my classes and the servlet classes i kept in the package com.sp.utility, and since my apllet is using some java classes from those so i kept that also in that. By default when we deploy all class files are generated in the WEB-INF/classes folder then again i have to build the necessory files with the Applet file ?
You don't have to build it again, you just have to copy the required files there. I'd put the code into various packages, maybe 1) servlets and related classes, 2) applet and related classes, 3) shared utility classes. That makes it easier to copy the right files to the right directories.
You need to be very careful only to copy the necessary files to the applet directory, and nothing else, especially no servlet classes. All class files that are publicly accessible can be decompiled, and then give away valuable information.
It's a beautiful day in this neighborhood - Fred Rogers. Tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss