Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > launch applet with APPLET or PLUGIN

Reply
Thread Tools

launch applet with APPLET or PLUGIN

 
 
cym tronik
Guest
Posts: n/a
 
      08-13-2005
Hi,
not sure this is the right place for my problem ...

In a web page I use an applet. If I launch the applet in a
HTML file, like this:

<APPLET CODE="myapplet.class" ...>

everything goes well. But if I launch it in a JSP file:

<jsplugin type="applet"
code="myapplet.class"
....>

the Firefox (1.03 and 1.06) says it needs a plug-in. When promted to
look for it, it says it cannot be found. The JSP generated by Tomcat
5.5.9 from the instruction "jsplugin ..." mentions :

<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width="600" height="420"
codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0">

i.e. the latest Java plug-in.

The EMBED part of the generated code for IE works fine, which drives
me mad, I hate IE.

Any idea of what's wrong ?

cymtronik
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      08-19-2005
On Sat, 13 Aug 2005 17:32:16 +0200, cym tronik wrote:

> In a web page


[1] URL?

>..I use an applet. If I launch the applet in a
> HTML file, .... everything goes well. But if
> I launch it in a JSP file:
>
> <jsplugin type="applet"
> code="myapplet.class"
> ...>


Just before I forget. Why the heck do you not simply
use the applet element? Is there anything specific to
the (invalid) nested OBJECT/EMBED element that you require,
that cannot be specified by the applet element?

> the Firefox (1.03 and 1.06) says it needs a plug-in. When promted to
> look for it, it says it cannot be found. The JSP generated by Tomcat
> 5.5.9 from the instruction "jsplugin ..." mentions :
>
> <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
> width="600" height="420"
> codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0">
>
> i.e. the latest Java plug-in.


Err... '1.2.2' I don't see it here..
<http://java.sun.com/j2se/1.4.2/docs/guide/deployment/autodl/autodl-files.html>
>
> The EMBED part of the generated code for IE works fine, which drives
> me mad, I hate IE.


Ain't it irritating? When the (accursed) IE is the only
one that gets it right.

> Any idea of what's wrong ?


Let me start with HTML (the inconsistencies between browser
renderings) applets (generally) Sun's lax attitude to both
HTML and (now) applets.. How much more do you want?

...Had you considered doing this as an application?

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"Not a word, could I relate. The story was quite clear.."
Led Zeppelin 'Kashmir'
 
Reply With Quote
 
 
 
 
cym tronik
Guest
Posts: n/a
 
      08-19-2005
On Fri, 19 Aug 2005 04:10:58 GMT, Andrew Thompson
<> wrote:

>......
>Just before I forget. Why the heck do you not simply
>use the applet element? Is there anything specific to
>the (invalid) nested OBJECT/EMBED element that you require,
>that cannot be specified by the applet element?


I may be wrong, but I believe there is a difference between the APPLET
tag and the jsplugin one. The former only makes the browser to load
Java if the browser is not yet Java enabled. If the applet uses newer
version of Java there may be problems. The jsplugin forces the
browser update the Java if necessary.

>> the Firefox (1.03 and 1.06) says it needs a plug-in. When promted to
>> look for it, it says it cannot be found. The JSP generated by Tomcat
>> 5.5.9 from the instruction "jsplugin ..." mentions :
>>
>> <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
>> width="600" height="420"
>> codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0">
>>
>> i.e. the latest Java plug-in.

>
>Err... '1.2.2' I don't see it here..


I have not pasted the whole Tomcat generated file. The codebase=... is
part of the file.

>.....
>..Had you considered doing this as an application?


It is an applet.

 
Reply With Quote
 
Raymond DeCampo
Guest
Posts: n/a
 
      08-19-2005
cym tronik wrote:
> On Fri, 19 Aug 2005 04:10:58 GMT, Andrew Thompson
> <> wrote:
>
>
>>......
>>Just before I forget. Why the heck do you not simply
>>use the applet element? Is there anything specific to
>>the (invalid) nested OBJECT/EMBED element that you require,
>>that cannot be specified by the applet element?

>
>
> I may be wrong, but I believe there is a difference between the APPLET
> tag and the jsplugin one. The former only makes the browser to load
> Java if the browser is not yet Java enabled. If the applet uses newer
> version of Java there may be problems. The jsplugin forces the
> browser update the Java if necessary.
>
>
>>>the Firefox (1.03 and 1.06) says it needs a plug-in. When promted to
>>>look for it, it says it cannot be found. The JSP generated by Tomcat
>>>5.5.9 from the instruction "jsplugin ..." mentions :
>>>
>>><OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
>>>width="600" height="420"
>>>codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0">
>>>
>>>i.e. the latest Java plug-in.

>>
>>Err... '1.2.2' I don't see it here..

>
>
> I have not pasted the whole Tomcat generated file. The codebase=... is
> part of the file.
>
>
>>.....
>>..Had you considered doing this as an application?

>
>
> It is an applet.
>


I do not see the OP on my news server yet, so forgive me if this is off
base. Are you specifying the JRE version you are targeting? Perhaps
targeting a later version will help.

HTH,
Ray

--
XML is the programmer's duct tape.
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      08-19-2005
On Fri, 19 Aug 2005 13:00:12 GMT, Raymond DeCampo wrote:
> cym tronik wrote:
>> On Fri, 19 Aug 2005 04:10:58 GMT, Andrew Thompson
>> <> wrote:


>>>><OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
>>>>width="600" height="420"
>>>>codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0">


> I do not see the OP on my news server yet,


Oddly, the OP's posts are coming in dated the 14th,
maybe that is screwing something up. (How long does
your news server retain posts?)

>..so forgive me if this is off
> base. Are you specifying the JRE version you are targeting?


The above codebase indicates 'Java 1.2.2', *but* the
classid[1] indicates to me that it specifies 'latest
java'. I find that element most confusing.

[1]
<http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html#note_3>

Perhaps it would help to see the complete statement written
in the original JSP that *generates* this HTML.

Actually, it just occured to me the OP specifically said
*Firefox*. Being a Mozilla based browser, it should completely
ignore the <OBJECT> element and would instead need the (invalid)
<EMBED> element.

>..Perhaps targeting a later version will help.


1.2.2 is not listed on the page with 'versions available',
they start at 1.3, but the 1.2.2 cab file certainly exists.

Viz.
<http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab>

To the OP.
What is the URL of your JSP? This is too slow.

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"Give me a ticket for an aeroplane, ain't got time to take a fast train.."
The Box Tops 'The Letter'
 
Reply With Quote
 
Dag Sunde
Guest
Posts: n/a
 
      08-19-2005
"Andrew Thompson" <> wrote in message
news:...
> On Fri, 19 Aug 2005 13:00:12 GMT, Raymond DeCampo wrote:
>> cym tronik wrote:
>>> On Fri, 19 Aug 2005 04:10:58 GMT, Andrew Thompson
>>> <> wrote:

>
>>>>><OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
>>>>>width="600" height="420"
>>>>>codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0">

>

<snipped
>>..so forgive me if this is off
>> base. Are you specifying the JRE version you are targeting?

>
> The above codebase indicates 'Java 1.2.2', *but* the
> classid[1] indicates to me that it specifies 'latest
> java'. I find that element most confusing.
>
> [1]
> <http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/using_tags.html#note_3>
>


The classid indicates what Sun call "Dynamic Versioning", and is used
together
with the codebase attibute.

If Codebase is set to
"...autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0"
the client will use any version later than or equal to 1.4.0 If this is not
present,
the latest release of the version indicated in the "Version=xxx" family will
be downloded (ie. at present: 1.4.2_06).

So where I think you misunderstood is that the classId given does *not*
indicate
the 'latest Java', but at least the version given in "Version=" in codebase.
If not
present, the latest version *of that family* (ie. the 1.4 family in my
example).

--
Dag.


 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      08-20-2005
On Sat, 20 Aug 2005 00:51:16 +0200, cym tronik wrote:

> On Fri, 19 Aug 2005 14:05:26 GMT, Andrew Thompson
> <> wrote:

...
>>Perhaps it would help to see the complete statement written
>>in the original JSP that *generates* this HTML.

>
> ok, here it is. My jsp file:
>
> <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">


You do not need a transitional doctype on this web page,
and the leading '\"' is invalid for HTML. I suggest..

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">

> <HTML><HEAD><TITLE>JApplet</TITLE></HEAD>
> <BODY>


<div>

> <jsplugin type="applet"
> code="ASV_applet.class"
> codebase = "/ASV_site"
> width="700" height="600">
> </jsplugin>


</div>

> </BODY></HTML>


Which leaves only 11 errors for the undefined
<EMBED>/<NOEMBED>/<COMMENT> elements and the
attributes associated with them.

(This is an irritation for me, as I usually like to
validate HTML before proceeding, but it is impossible
when using the nested <OBJECT>/<EMBED> structure.)

OK.. I've changed the parameters, so I'll trim the rest
of your 'what Tomcat said'...

The above .JSP produces (in my tomcat)..

***
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML><HEAD><TITLE>JApplet</TITLE></HEAD>
<BODY>
<div>
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="700"
height="600"
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="ASV_applet.class">
<PARAM name="java_codebase" value="/ASV_site">
<PARAM name="type" value="application/x-java-applet;">
<COMMENT>
<EMBED type="application/x-java-applet;" width="700" height="600"
pluginspage="http://java.sun.com/products/plugin/"
java_code="ASV_applet.class" java_codebase="/ASV_site"
>

<NOEMBED>
</COMMENT>
</NOEMBED></EMBED>
</OBJECT>

</div>
</BODY></HTML>
***

That HTML prompted me to install the plug-in, but I
chose to ingore/cancel it, since I use 1.5 Java in Mozilla

I assume that mimics the behaviour you are seeing in FireFox?

...I saw a suspicious character in that output and removed
it, to produce this (note: *1* character different)..
***
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<HTML><HEAD><TITLE>JApplet</TITLE></HEAD>
<BODY>
<div>
<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="700"
height="600"
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="ASV_applet.class">
<PARAM name="java_codebase" value="/ASV_site">
<PARAM name="type" value="application/x-java-applet;">
<COMMENT>
<EMBED type="application/x-java-applet" width="700" height="600"
pluginspage="http://java.sun.com/products/plugin/"
java_code="ASV_applet.class" java_codebase="/ASV_site"
>

<NOEMBED>
</COMMENT>
</NOEMBED></EMBED>
</OBJECT>

</div>
</BODY></HTML>
***

Here, that second HTML produce an NPE when the browser
could not find the class.

Try it in your FireFox.

Ray.. do you still wonder why I avoid using the 'easy'
'<jsplugin' way of placing applets in pages?
Sun seems to not have the first clue when it comes to
...about everything related to HTML and JavaScript, I
would prefer to rely on the applet element.

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"I have to turn my head, until my darkness goes"
The Rolling Stones 'Paint It Black'
 
Reply With Quote
 
cym tronik
Guest
Posts: n/a
 
      08-20-2005
Thanks Andrew,
you've put me on the track. Your version of Tomcat is different of
mine, your _working_ file:

><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
><HTML><HEAD><TITLE>JApplet</TITLE></HEAD>
><BODY>
><div>
><OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="700"
>height="600"
>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="ASV_applet.class">
><PARAM name="java_codebase" value="/ASV_site">
><PARAM name="type" value="application/x-java-applet;">
><COMMENT>
><EMBED type="application/x-java-applet;" width="700" height="600"
>pluginspage="http://java.sun.com/products/plugin/"
>java_code="ASV_applet.class" java_codebase="/ASV_site"
>>

><NOEMBED>
></COMMENT>
></NOEMBED></EMBED>
></OBJECT>
>
></div>
></BODY></HTML>


fails in my Firefox, but the next one, with the suspicious semicolon
in <EMBED removed:

><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
><HTML><HEAD><TITLE>JApplet</TITLE></HEAD>
><BODY>
><div>
><OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="700"
>height="600"
>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="ASV_applet.class">
><PARAM name="java_codebase" value="/ASV_site">
><PARAM name="type" value="application/x-java-applet;">
><COMMENT>
><EMBED type="application/x-java-applet" width="700" height="600"
>pluginspage="http://java.sun.com/products/plugin/"
>java_code="ASV_applet.class" java_codebase="/ASV_site"
>>

><NOEMBED>
></COMMENT>
></NOEMBED></EMBED>
></OBJECT>
>
></div>
></BODY></HTML>


works fine. Now I have something to report to the Tomcat people.

Regards

Cym

 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      08-20-2005
On Sat, 20 Aug 2005 12:15:18 +0200, cym tronik wrote:

> Thanks Andrew,
> you've put me on the track. Your version of Tomcat is different of
> mine, your _working_ file:

....
>><EMBED type="application/x-java-applet;" width="700" height="600"

....
> fails in my Firefox, but the next one, with the suspicious semicolon
> in <EMBED removed:

...
>><EMBED type="application/x-java-applet" width="700" height="600"

...
> works fine. Now I have something to report to the Tomcat people.


I don't think it is quite that straightforward.
This is the first time I have looked closely at the
output of the <jsplugin statement, generally I use
the <APPLET> element.

After poking further into the jsplugin element at
the bug database, I realised why the ';' is there
(docs may also have indicated, but..) for a reason.
Look at these bugs, and notice that after the semi-colon
is a 'version=n.n.n'.

<http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4823518>
...
type="application/x-java-applet;version=1.4.1_01"

<http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4870461>
...
type="application/x-java-applet;version=1.3.1"

Maybe Ray 'hit the nail on the head' for the solution..
Specify a version later than 1.2.2 and the plugin element
will most likely complete that attribute with a sensible value.

OTOH, the absence of ..
type="application/x-java-applet;version=1.2.2"
...does seem like a bug (to me).

--
Andrew Thompson
physci.org 1point1c.org javasaver.com lensescapes.com athompson.info
"As it is I'm climbing up an endless wall. No time at all."
The Police 'No Time This Time'
 
Reply With Quote
 
cym tronik
Guest
Posts: n/a
 
      08-20-2005
On Sat, 20 Aug 2005 12:06:14 GMT, Andrew Thompson
<> wrote:

>...
>After poking further into the jsplugin element at
>the bug database, I realised why the ';' is there
>(docs may also have indicated, but..) for a reason.
>Look at these bugs, and notice that after the semi-colon
>is a 'version=n.n.n'.


I've tried the version attribute, I've even pasted an example from
Sun's tutorial page, and it does not work. I've tried space, slash,
dollar instead of this semicolon, no better. I think it is a bug, yes.

Cym
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Eclipse Plugin: how to modify perl build path from an eclipse Plugin java class eser@libero.it Java 1 09-07-2007 09:45 PM
Getting reference of eclipse plugin view or its component from another eclipse plugin view? Jimmy Java 0 03-15-2007 11:04 PM
tomcat-maven-plugin problem - mvn is looking for org.apache.maven.plugins:maven-tomcat-plugin Marcin Cenkier Java 1 04-12-2006 08:00 PM
Detect if Sun plugin is installed (in IE) EVEN if not set as default in plugin? PilotYid Java 1 10-31-2005 11:13 AM
Cannot use JavaScript to launch a signed Java applet Terri I. Java 3 09-04-2003 09:30 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57