Dynamically allocating ports and assigning device names

For Internet Explorer and Firefox browsers

These two samples demonstrate how to dynamically:

  • Specify a port number in a terminal session. The applet launches the session in a separate window.

  • Specify a device name or pool in an IBM 3270 Printer session. For example, you could modify this code to assign a device name to specific users based on the user name. The applet launches the terminal session in a separate window. Devices are used in IBM emulation sessions only.

To start a terminal session using this sample page

  1. Copy the sample JavaScript code below to an HTML file.

  2. In the first block of JavaScript code, add custom code to determine the port number or device name you want to use. The inserted code should return the string (in quotes) of the port or device name to use.

  3. In the hostURL parameter, replace myHost with the name or URL of the host to which you want to connect.

  4. To specify a port number: In the launcher.sessions parameter, replace session type with the appropriate session type indicator:

    Session type

    Indicator

    HP

    HP

    IBM 3270

    IBM 3270

    IBM 3270 printer

    IBM3287

    IBM 5250

    IBM 5250

    IBM 5250 printer

    IBM 3812

    IBM AS/400 data transfer

    IBM 5250Xfer

    VT

    VT

    To specify a device name: skip to step 5.

  5. Save the file in the deploy folder.