Verwendug von applet,object und embed tags

hallo
ich habe j2se 1.5.0_05 und jre 1.5.0_05 auf meinem rechner.
ich rufe ein applet vom browser (i.e) über eine jsp datei, die den plugin automatisch installiert falls sie nicht schon drauf ist
zb http://ip:8080/plugin.jsp
--------plugin.jsp----------------

\<!--
 var \_info = navigator.userAgent;
 var \_ns = false; 
 var \_ns6 = false;
 var \_ie = (\_info.indexOf("MSIE") \> 0 
 && \_info.indexOf("Win") \> 0 
 && \_info.indexOf("Windows 3.1") \< 0);

//--\>

\<!--
 var \_ns = (navigator.appName.indexOf("Netscape") \>= 0 
 && ((\_info.indexOf("Win") \> 0 && \_info.indexOf("Win16") \< 0 
 && java.lang.System.getProperty("os.version").indexOf("3.5") \<0)
 || (\_info.indexOf("Sun") \> 0) || (\_info.indexOf("Linux") \> 0) 
 || (\_info.indexOf("AIX") \> 0) || (\_info.indexOf("OS/2") \> 0)));


 var \_ns6 = ((\_ns == true) && (\_info.indexOf("Mozilla/5") \>= 0));
//--\>

\<!--
 if (\_ie == true) 
 document.writeln('\<OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9- 00805F499D93" 
 width="500"
 height="200" 
 codebase="http://java.sun.com/products/plugin/autodl/jinstall-1\_5\_0\_05-windows-i586.cab#Version=1,5,0,5"\>\<NOEMBED\>\<XMP\>'); 


 else if (\_ns == true && \_ns6 == false)
document.writeln('\<EMBED type="application/x-java-applet;jpi- version=1\_5\_0\_05" 
width="1024" 
height="768" 

align="baseline" 

code=MeinApplet.class" 
codebase="/" 
ARCHIVE = "fat\_gel.jar" 
scriptable=false 
pluginspage="http://java.sun.com/j2se/1.5.0/download.html"\>
\<NOEMBED\>\<XMP\>');
//--\>



 No Java 2 SDK, Standard Edition v 1.5 support for APPLET!!

wenn ich das Applet über die jsp-datei aufrufe bekomme ich
die folgende fehlermeldung aber ein direkter aufruf zb (http://ip:8080/MeinApplet.html) läuft einwandfrei:

java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread „Thread-4“ java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread „thread applet-null“ java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

es hat sehr warscheinlich mit diese embed , object tags und die plugin angaben in der jsp-datei zu tun.
hat jemand eine idee ?
danke im voraus

youssef

Auch hallo.

hallo
ich habe j2se 1.5.0_05 und jre 1.5.0_05 auf meinem rechner.

Suse Linux 9.3, FF 1.0.7, JDK 1.4.x -> läuft ohne Probleme :smile:

ich rufe ein applet vom browser (i.e) über eine jsp datei, die
den plugin automatisch installiert falls sie nicht schon drauf
ist
zb http://ip:8080/plugin.jsp

Adresse funktioniert :smile:

--------plugin.jsp----------------

<!–
var _info = navigator.userAgent;
var _ns = false;
var _ns6 = false;
var _ie = (_info.indexOf(„MSIE“) > 0
&& _info.indexOf(„Win“) > 0
&& _info.indexOf(„Windows 3.1“) < 0);

//–>

<!–
var _ns = (navigator.appName.indexOf(„Netscape“) >= 0
&& ((_info.indexOf(„Win“) > 0 &&
_info.indexOf(„Win16“) < 0
&&
java.lang.System.getProperty(„os.version“).indexOf(„3.5“)
<0)
|| (_info.indexOf(„Sun“) > 0) ||
(_info.indexOf(„Linux“) > 0)
|| (_info.indexOf(„AIX“) > 0) ||
(_info.indexOf(„OS/2“) > 0)));

var _ns6 = ((_ns == true) && (_info.indexOf(„Mozilla/5“)
>= 0));
//–>

<!–
if (_ie == true)
document.writeln(’<OBJECT
classid=„clsid:8AD9C840-044E-11D1-B3E9- 00805F499D93“
width=„500“
height=„200“

codebase=„http://java.sun.com/products/plugin/autodl/jinstall-1_5_0_05-windows-i586.cab#Version=1,5,0,5“><NOEMBED><XMP>’);

else if (_ns == true && _ns6 == false)
document.writeln(’<EMBED
type=„application/x-java-applet;jpi- version=1_5_0_05“
width=„1024“
height=„768“

align=„baseline“

code=MeinApplet.class"
codebase="/"
ARCHIVE = „fat_gel.jar“
scriptable=false
pluginspage=„http://java.sun.com/j2se/1.5.0/download.html“>
<NOEMBED><XMP>’);
//–>

No Java 2 SDK, Standard Edition v 1.5 support for APPLET!!


…und wieso JSP und nicht HTML ?
JSP-Seiten haben i.A. andere Code Tags :wink:

wenn ich das Applet über die jsp-datei aufrufe bekomme ich
die folgende fehlermeldung aber ein direkter aufruf zb
(http://ip:8080/MeinApplet.html) läuft einwandfrei:

java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown
Source)
at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread „Thread-4“ java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown
Source)
at sun.plugin.AppletViewer.showAppletException(Unknown
Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown
Source)
at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread „thread applet-null“
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown
Source)
at sun.plugin.AppletViewer.showAppletException(Unknown
Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

es hat sehr warscheinlich mit diese embed , object tags und
die plugin angaben in der jsp-datei zu tun.

JSP = Java Server Page, also eine .jsp Seite, die Javabefehle enthält und von Apache Tomcat interpretiert werden kann.
Die gezeigte Kombination ist HTML & JavaScript.
Man kann diese Technologien natürlich mischen, nur sollten Applets nach wie vor über HTML und/oder JavaScript geladen werden. JSP-Befehle sind für so etwas eigetnlich nicht gemacht worden :wink:
Siehe auch http://www.entwickler-forum.de - suche nach ‚Applet JSP‘

HTH
mfg M.L.

hallo und danke fuer die Antwort

…und wieso JSP und nicht HTML ?
JSP-Seiten haben i.A. andere Code Tags :wink:

es hat sehr warscheinlich mit diese embed , object tags und
die plugin angaben in der jsp-datei zu tun.

JSP = Java Server Page, also eine .jsp Seite, die Javabefehle
enthält und von Apache Tomcat interpretiert werden kann.
Die gezeigte Kombination ist HTML & JavaScript.
Man kann diese Technologien natürlich mischen, nur sollten
Applets nach wie vor über HTML und/oder JavaScript geladen
werden. JSP-Befehle sind für so etwas eigetnlich nicht gemacht
worden :wink:
Siehe auch http://www.entwickler-forum.de - suche nach ‚Applet
JSP‘

du hast völlig recht. ich habe die Datei nach html umbennant
(plugin.html statt plugin.jsp jetzt) aber das hat mit der Fehler nicht zu tun. sie ist imer da.
hast du vielleicht eine idee ?

Gruss
youssef