wood burning stoves 2.0*
The moose likes Applets and the fly likes How to Load the applet only if the activeX component could not be found? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "How to Load the applet only if the activeX component could not be found?" Watch "How to Load the applet only if the activeX component could not be found?" New topic
Author

How to Load the applet only if the activeX component could not be found?

Zen Goh
Greenhorn

Joined: Jul 20, 2009
Posts: 1
Hi guys,

Currently, the login page of my web application will load a activeX component in order to access a desktop application installed on the client's PC. There is a ongoing change in the login procedure, we will be using applets instead. The problem is, I have to provide support for logging in using the activeX components as well for the transition period of 6 months.

Is there a way to load the applet or an activeX alternatively on the same jsp using the OBJECT tags? (ie. if the activeX component could be loaded, then do not load the applet. If the activeX component is not present then load the applet.)

I tried using nested OBJECT tags but its seems like the browser will try to load both objects. It prompted the warning that the webpage is trying to run a ActiveX component and after clicked on 'Ok' it tries to load the Applet as well.

<!-- Try to load ActiveX first -->
<OBJECT type="application/x-oleobject" ID="ActiveXLogin" CLASSID="clsid:xxxxxx" CODEBASE='/ocx/login.ocx' WIDTH="0" HEIGHT="0">
<!-- Load Applet if the ActiveX could not be found -->
<OBJECT CODEBASE='http://devt/applet' CODE='Applet/Login'
width='0' height='0' ARCHIVE='Login.jar' NAME=Login >
<PARAM NAME="legacy_lifecycle" VALUE="true">
</OBJECT>
<!-- End Applet -->
</OBJECT>
<!-- End ActiveX>

Thanks for any suggestions/advice!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to Load the applet only if the activeX component could not be found?