aspose file tools*
The moose likes Applets and the fly likes Applet embedded in JSP doesn't run on browser with older than JRE-1.6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet embedded in JSP doesn Watch "Applet embedded in JSP doesn New topic
Author

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

Nitin Sinha
Greenhorn

Joined: May 08, 2008
Posts: 17
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
Marshal

Joined: Mar 22, 2005
Posts: 42648
    
  65
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.


Ping & DNS - my free Android networking tools app
Nitin Sinha
Greenhorn

Joined: May 08, 2008
Posts: 17
Could you please throw some more light programatically on how to get this done. Thanks !
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42648
    
  65
It would be something like this:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet embedded in JSP doesn't run on browser with older than JRE-1.6