This page will look better in a graphical browser that supports web standards, but is accessible to any browser or internet device.

Served by Samwise.

Cardiac Physiome Society workshop: November 6-9, 2017 , Toronto

Administering a JSim-enabled Web Site

This page is for the current JSim version 2.0. Click here for the earlier JSim 1.6 version.

Introduction

This document gives describes how to write and serve JSim-enabled Web pages which allow you to demonstrate JSim, or particular models, to the public. This document assumes you are familiar with HTML, Web server administration and JSim remote server administration .

Contents:

Trusted and Untrusted Applets

JSim can run as a java applet within an HTML Web page. It may operate in either trusted or untrusted mode. In either mode, the JSim applet can load demonstration projects, run models and plot results. However, when operating in untrusted mode the applet may not:

When an untrusted applet attempts an unpermitted operation, an error message will be generated, and the program will exit or continue as is appropriate.

Establishing an applet as trusted is a complex subject, and will not be dealt with here in great detail. The method used at the NSR website to establish trust is described at the end of this document .

Remote Model Computation

Since JSim's numerical library relies on native libraries, which are not allowed in applets (trusted or not), JSim applets perform model calculations on a host running the JSim server . Untrusted applet network connections are restricted to the host that serves the applet jar file (JSimClient.jar), meaning a JSim server must be running there. Trusted applets may connect to any network host (see the -server switch below).

HTML Usage

A comprehensive HTML and WWW server administration tutorial is beyond the scope of this document, which offers only a few simple examples of JSim applet usage within HTML. HTML authors interested in the JSim applet should consult HTML standard documentation for complete details and work with their local WWW server administrator.

An JSim applet is embedded in HTML via the object or applet tags using the java archive JSIMHOME/lib/JSimClient.jar from your JSim distribution. For example:

      <object
        type="application/x-java-applet"
        classid="java:JSim.gui.GLaunch"
        archive="JSimClient.jar"
        width="1000"
        height="600"
        args="-f demo.proj"
      >
      </object>

or alternatively:

      <applet
        code="JSim.gui.GLaunch"
        archive="JSimClient.jar"
        width="1000"
        height="600"
      >
      <param name=args value="-f demo.proj">
      </applet>

These examples assume the file demo.proj is served (via HTTP) from the same directory as JSimClient.jar.

All the normal command-line switches are available via the args tag above, however some switches have slightly altered meanings in the applet context:

Note for advanced administrators: It has been noted that untrusted applets may have permission difficulties accessing a JSim server on a computer with multiple IP addresses, depending on how the host OS directs traffic between those addresses. In such cases, the applet/object codebase attribute and the -server and -userurl JSim switches may need to all point to the primary IP address of the server.

Browser Requirements

The JSim applet requires the user's browser have a Sun Java 1.6 compatible plug-in installed. See Running JSim inside a Web Browser for complete information.

Applet Trust Implementation at NSR

On the NSR web site, various pages use the JSim applet in both trusted and untrusted mode. Those that use trusted mode, implement trust via a signed jar file. Sun's keytool and jarsigner programs are used to digitally sign JSimClient.jar. For example:

      keytool -genkey -alias JSimApplet

      jarsigner JSimClient.jar JSimApplet

When the signed jar file is downloaded by a Java 2 compliant browser, the user is presented with a dialog box asking if s/he wishes to trust the applet. If s/he agrees, the applet will run in trusted mode. If not, the applet will run in untrusted mode.

Please note that the JSimClient.jar distributed with JSim is not signed. If you wish to follow NSR's trust scheme at your web-site, you will need to sign the jar file locally.

Applet security is a very complex topic and there are numerous alternative approaches to the one taken at NSR. It is possible that we will change or refine our approach in the future to meet new security concerns.

Comments or Questions?

[This page was last modified 06Jul12, 3:06 pm.]

Model development and archiving support at physiome.org provided by the following grants: NIH/NIBIB BE08407 Software Integration, JSim and SBW 6/1/09-5/31/13; NIH/NHLBI T15 HL88516-01 Modeling for Heart, Lung and Blood: From Cell to Organ, 4/1/07-3/31/11; NSF BES-0506477 Adaptive Multi-Scale Model Simulation, 8/15/05-7/31/08; NIH/NHLBI R01 HL073598 Core 3: 3D Imaging and Computer Modeling of the Respiratory Tract, 9/1/04-8/31/09; as well as prior support from NIH/NCRR P41 RR01243 Simulation Resource in Circulatory Mass Transport and Exchange, 12/1/1980-11/30/01 and NIH/NIBIB R01 EB001973 JSim: A Simulation Analysis Platform, 3/1/02-2/28/07.