Re: html page can not present an java Applet embedded in the page

2013-01-29 Thread André Warnier

qingtao peng wrote:

  I have built the apache-tomcat-7.0.32 server on my computer.My operating 
system is Windows7.I place a html page named DbApplet.html under the directory 
of DbServlet in the webapps of the apache-tomcat-7.0.32 server .My DbApplet.htm 
code is as follow :

 
 
 
  
 http://localhost:8080/DbServlet/build/classes/servlet/"; classid = 
"DbApplet.class"  width = "600" height = "600" name = "DbApplet">
 
  
  


I have started the apache-tomcat-7.0.32 server.Then i type 
http://localhost:8080/DbServlet/DbApplet.html in the field of the address on 
the browser.I can open the page on the browser,but the html page can not 
present the java Applet embedded in the page.I have encoded the java Applet and 
compiled it into the class named DbApplet.class.I
place it under  the directory of DbServlet/build/classes/servlet in the 
directory of the webapps of the apache-tomcat-7.0.32 server .Why can the page 
not present my java Applet.
I thank you for helping


You may want to open the Java error console on your workstation, and look at any messages 
shown there.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: html page can not present an java Applet embedded in the page

2013-01-29 Thread Konstantin Preißer
Hi,

> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Tuesday, January 29, 2013 6:38 PM
> To: Tomcat Users List
> Subject: Re: html page can not present an java Applet embedded in the
> page
> 
> Also, Oracle says this only works with Microsoft Internet Explorer. An
> online HOW-TO[2] (a bit dated) says that you can still use  in
> other browsers, but the syntax is a little different:
> 
>type="application/x-java-applet">
>   
> [...]
> 
> 
> I'm not sure why you have to specify the class name twice in there.
> That page also shows you how to embed Java applets in such a way that
> they will work in both MSIE and everywhere else. Oracle has similar
> documentation in their page I referenced, though using a different
> technique. You'll have to test in your target environment to see what
> actually works for you.


I don't know why Oracle says that you need different syntaxes for IE and other 
browsers (that probably applied to old versions of the HTML spec and browsers), 
since e.g. the following syntax works for me with IE, Firefox and Chrome (which 
is also given as a example in the current HTML5 spec [1]):

  




Your don't have the Java plugin installed...
  


However, I would recommend the  element because it allows Browsers to 
display a specific error message when the Java plugin is not installed:

  


Regards,
Konstantin Preißer


[1] http://www.w3.org/TR/html51/embedded-content-0.html#the-object-element


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: html page can not present an java Applet embedded in the page

2013-01-29 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Gingtao,

On 1/29/13 7:45 AM, qingtao peng wrote:
> I have built the apache-tomcat-7.0.32 server on my computer.My 
> operating system is Windows7.I place a html page named
> DbApplet.html under the directory of DbServlet in the webapps of
> the apache-tomcat-7.0.32 server .My DbApplet.htm code is as follow
> :
> 
>   codebase="http://localhost:8080/DbServlet/build/classes/servlet/";
> classid = "DbApplet.class"  width = "600" height = "600" name =
> "DbApplet">
> 
> I have started the apache-tomcat-7.0.32 server.Then i type 
> http://localhost:8080/DbServlet/DbApplet.html in the field of the 
> address on the browser.I can open the page on the browser,but the 
> html page can not present the java Applet embedded in the page.I
> have encoded the java Applet and compiled it into the class named 
> DbApplet.class.I place it under  the directory of 
> DbServlet/build/classes/servlet in the directory of the webapps of 
> the apache-tomcat-7.0.32 server .Why can the page not present my
> java Applet.

The available online documentation is a bit murky these days. Oracle's
own documentation[1] does not explain how to tell the browser where
your code is (e.g. in a JAR file on the server). I suspect it should
be done this way:


  http://localhost:8080/DbServlet/build/classes/servlet/"; />
  


You should ensure that the URL
http://localhost:8080/DbServlet/build/classes/servlet/DbApplet.class
actually returns something. If Tomcat refuses to serve that request,
you'll get nothing.

Also, Oracle says this only works with Microsoft Internet Explorer. An
online HOW-TO[2] (a bit dated) says that you can still use  in
other browsers, but the syntax is a little different:


  
[...]


I'm not sure why you have to specify the class name twice in there.
That page also shows you how to embed Java applets in such a way that
they will work in both MSIE and everywhere else. Oracle has similar
documentation in their page I referenced, though using a different
technique. You'll have to test in your target environment to see what
actually works for you.

Good luck,
- -chris

[1]
http://download.java.net/jdk8/docs/technotes/guides/jweb/applet/using_tags.html
[2]
http://depth-first.com/articles/2008/02/20/demystifying-java-applets-part-1-cross-browser-standards-compliant-pure-html-deployment-using-the-object-tag/
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlEICO0ACgkQ9CaO5/Lv0PAa3gCcD0QN+PjtpI5gWBulGW0A2kJu
5VAAoJJ1E/7o356crfZw5h3eAS6BZTw3
=Rftp
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org