Results 1 to 8 of 8
Thread: Deploying an applet with jsp
- 01-27-2010, 01:50 PM #1
Member
- Join Date
- Jul 2009
- Posts
- 11
- Rep Power
- 0
Deploying an applet with jsp
Hi,
I am trying to make an applet accessible through a JSP, but it won't load, I have the following error in my browser's Java console:
java.lang.ClassFormatError: Incompatible magic value 1013461310 in class file MyApplet
...
The applet is in the same directory of the JSP that calls it wich is the root of the project. Here's the code in the JSP:
Java Code:<jsp: plugin type="applet" codebase="." code="MyApplet.class" width="408" height="410" > <jsp:fallback> Plugin tag OBJECT or EMBED not supported by browser. </jsp:fallback> </jsp: plugin>
There are no preblems when I call the applet from a usual html file with the applet tag.
What am I doing wrong?
- 01-27-2010, 02:21 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
What does the applet tag look like in the html page that works, and what does the tag look like from the jsp page as displayed on the browser?
- 01-27-2010, 02:30 PM #3
Member
- Join Date
- Jul 2009
- Posts
- 11
- Rep Power
- 0
Hi,
html code that works :
<applet codebase="." code="MyApplet.class" width="408" height="410"></applet>
JSP generated code in the browser :
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="408" height="410" codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0">
<param name="java_code" value="MyApplet.class">
<param name="java_codebase" value=".">
<param name="type" value="application/x-java-applet;version=1.1">
<comment>
<EMBED type="application/x-java-applet;version=1.1" width="408" height="410" pluginspage="http://java.sun.com/products/plugin/" java_code="MyApplet.class" java_codebase="."/>
<noembed>
Plugin tag OBJECT or EMBED not supported by browser.
</noembed>
</comment>
</object>
This is the first time I try to include an applet in a JSP and I am not familiar to the object tag, sorry if there's anything wrong that is too obvious.Last edited by IamKira; 01-27-2010 at 02:33 PM.
- 01-27-2010, 02:44 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
I've not used <plugin>, and I haven't done an applet in well over 5 years.
I'd look into what's expected for <object> and then try and hand code that one in the html page and get it to work. Then you might have a better idea of what's expected by <plugin>, or what it's doing.
- 01-27-2010, 03:32 PM #5
Member
- Join Date
- Jul 2009
- Posts
- 11
- Rep Power
- 0
This is strange. Sun says that the object tag should be use to deploy applets that are to be used only with internet explorer.
- 01-27-2010, 03:40 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Well, <plugin> decides (based on the client browser) whether to use <object> or <embed>. So presumably you were using an IE-like browser.
- 01-27-2010, 03:49 PM #7
Member
- Join Date
- Jul 2009
- Posts
- 11
- Rep Power
- 0
Nope, I am on Firefox. This is depressing.
- 01-27-2010, 04:09 PM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Similar Threads
-
Problem deploying applet to browser
By nfteodoro in forum Java AppletsReplies: 4Last Post: 09-25-2009, 10:03 AM -
Deploying Servlets
By gapper in forum New To JavaReplies: 2Last Post: 01-17-2008, 12:43 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks