applet class not found when deploying the project using tomcat
In my project i have an html page which has to display an applet. while developing the project the applet class is placed under src>att>prog folder and the html pages are placed under web folder.
while the project archive is made by tomcat the placement of applet.class is WEB-INF>classes>att>prog.
Now how can i give path of the applet class on my html page.
i tried the following way but still the applet.class cannot be found. how to give the path of the applet now so as be resolved under tomcat directory structure.
<HTML>
<HEAD>
<TITLE>Importing video to applet</TITLE>
<BODY>
This is the applet to check swing component :-
<P>
<center><applet code ="applet.class"
codebase="../WEB-INF/classes/att/prog" width ="320" height ="280" align="middle">
</applet></center>
</BODY>
</HTML>
please help and suggest.
thanks in advance. :-)
[1155 byte] By [
rahulsaha] at [2007-11-26 18:16:15]

> In my project i have an html page which has to
> display an applet. while developing the project the
> applet class is placed under src>att>prog folder and
> the html pages are placed under web folder.
> while the project archive is made by tomcat the
> placement of applet.class is
> WEB-INF>classes>att>prog.
> Now how can i give path of the applet class on my
> html page.
> i tried the following way but still the applet.class
> cannot be found. how to give the path of the applet
> now so as be resolved under tomcat directory
> structure.
> <HTML>
><HEAD>
> <TITLE>Importing video to applet</TITLE>
><BODY>
> This is the applet to check swing component :-
><P>
><center><applet code = "applet.class"
> codebase="../WEB-INF/classes/att/prog" width =
> "320" height = "280" align="middle">
></applet></center>
>
></BODY>
> L>
>
> please help and suggest.
> thanks in advance. :-)
try the following combinations
<applet code = "applet.class" codebase="/WEB-INF/classes/att/prog" width = "320" height = "280" align="middle"></applet>
<applet code = "applet.class" codebase="WEB-INF/classes/att/prog" width = "320" height = "280" align="middle"></applet>
if they don't work.. i don't know anymore lolss
Applet class files are served just like HTML or images, they aren't part of the server architecture at all. You can't put them in WEB-INF because the server specifically protects files in WEB-INF from being served, it's where you put stuff you don't want the client side to have access to.
I suggest you wrap your applet up in a jar, but in any case put it in a servable directory.
> Applet class files are served just like HTML or
> images, they aren't part of the server architecture
> at all. You can't put them in WEB-INF because the
> server specifically protects files in WEB-INF from
> being served, it's where you put stuff you don't want
> the client side to have access to.
>
> I suggest you wrap your applet up in a jar, but in
> any case put it in a servable directory.
@malcolmmc
I agree with ur WEB-INF explanation. now can u suggest a way how can i place the applet class in a jar and place that in a servable directory also. also i want to put forward a situation to you. this applet is to show video from a web-cam on to the browser window. now when user clicks a button his image is to be saved. so how can other classes under WEB-INF wuld be able to access the methods for same when this applet.class would be under a jar file.
any suggestions now plz.
o how can other classes under WEB-INF wuld
> be able to access the methods for same when this
> applet.class would be under a jar file.
> any suggestions now plz.
Nothing in the WEB-INF directory is ever available from the browser. If you have classes in common between your Applet and Servlet/JSP then the classes must be duplicated. One set in WEB-INF/classes and the other set your Applet jar or a directory accessible to your Applet.
Remember that the applet, and the server are running in separate JVMs on separate machines. Even if they use some of the same classes, they will be using different copies of those classes.
If the applet wants to save an image on the server it must upload that image. The only way to do this, without using a signed applet, is to use a separate http transaction initiated by the applet, typically either a POST or a PUT transaction. A servlet then accepts that transaction and files the image. Classes on the server can't just access classes on the client side.
@ above two..thanx a lot.. will implement the necessary changes now.btw.. by saying use a separate http transaction initiated by the applet, typically either a POST or a PUT transactionu mean that thru applet i can call servlets actions..right..