Forums Register Login

Servlet can Call an Applet

+Pie Number of slices to send: Send
My Question is when servlet call an applet like this
out.println("<applet code=xyz.class codebase=http://..... width=200 height=400></applet>")
is this works?? if yes kindly tell me where the xyz.class should placed or how should i call an applet class in servlet??
i have placed xyz.class file in the same directory as my servlet class file.
ie. http://url/servlet directory.
what path should i give it to call my applet in servlet.should it be
out.println("<applet code=xyz.class codebase=http://url/servlet/ width=200 height=400></applet>")
or if i place my applet xyz.class in html directory.then how should i give the path. since
both the ways are not working.
it is should applet load: class xyz not found
thanks in advance
+Pie Number of slices to send: Send
1. Servlets don't call applets, servlets write HTML pages that have embedded applet tags.
2. Applet classes are loaded by applet rules NOT servlet rules. They are loaded by requests from the browser to the web server so the class files have to be where the web server can serve them. Servers are forbidden to serve files from WEB-INF.
3. A page written by a servlet should look just like a static HTML page when it gets to the browser.
You should start by creating a static page containing your applet and get that running. Then you can work on making your servlet write a page containing the applet tag.
Bill
+Pie Number of slices to send: Send
In short you just have to use Http Tunneling.
-jignesh
+Pie Number of slices to send: Send
 

Originally posted by j_kokil:
In short you just have to use Http Tunneling.


Hi Jignesh,
I am afraid we are not talking about HTTP tunneling here, are we Bill? This query was not about Applet-Servlet communication, the servlets simply creates an APPLET tag. HTTP tunneling is simply a way of bypassing firewall restrictions and enabling Java applets to communicate with the servers.
+Pie Number of slices to send: Send
As I understand the use of the word, we are not talking about HTTP tunneling when a browser loads an applet by requesting class files from the server. Now, if the applet exchanges data with the server using a HttpURLConnection, I would call it tunneling.
Bill
Wait for it ... wait .... wait .... NOW! Pafiffle! A perfect tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1705 times.
Similar Threads
Basic concept in Applet-Servlet communication ?
ServletRunner
doubt in servlets
passing a parameter from servlet to applet
Servlet can Call an Applet
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 01:51:41.