• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applet embedded in JSP doesn't run on browser with older than JRE-1.6

 
Nitin Sinha
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have embeded an Applet in my JSP Page which used JDK1.6's getHardwareAddress() method to get user's physical address.
I have embeeded this into a JAR file and used it in my JSP where this applet run on onload() event of the form --> runs the applet --> and gets physical address of user machine and prints it in one of the text boxes on the form.

Now, the issue is that the applet doesn't run on browser that doesn't support JRE 1.6

My concern is that how can I run this (if at all possible) in browsers that support lower versions of JRE or is it possible to check that if the browser doesn't support JRE 1.6 then load the basic version of form without running the applet. Can i actually check the version of browser JRE somehow and stop to execute the applet. Because what happens as of now is that if the applet doesn't execute, the complete form fails to load.

The last option is that I give a message on my web page that redirects user to Sun Java site and asks them to update their browsers.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can compile the applet with the "-source" and "-target" switches set to whatever Java version you want to support; these days, Java 5 should be OK for the overwhelming majority of desktops.

Then the applet can check the "java.version" system property, and only execute the call to that method if it's running on a Java 6 (of higher) JRE.
 
Nitin Sinha
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please throw some more light programatically on how to get this done. Thanks !
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be something like this:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic