1.0 Product overview

Mocha TN3270 is a 3270 emulator written in java, which makes it possible from a java enabled browser, to connect an IBM Mainframe server.

1.1 Functionality

1.2 Clipboard

Use the mouse to select an area, or 2 x click a word on the screen. Use ALT+C to copy, ALT+V to paste. ALT+A to select all.

1.3 Connect

It is possible to connect to a host from the File menu. A pop-up window is shown. Enter a host name and a port number . The port number for TN3270 is default 23.

Another solution is to give the ip and port address in the HTML file loading the TN3270 applet.

1.4 Function keys

Function keys can beused from the keyboard, or the toolbar

1.5 Focus

If keyboard focus, the cursor will be shown. On some browsers, focus must be clicked after a dialog box, such as the connect dialog has been closed.

1.6 Status line

1.7 Known problems with Applets

2.0 Parameters

Parameters to Mocha TN3270 is given in the HTML file loading the java application. Nothing is stored on the users workstation.

2.1 HTML page

An applet is defined in a HTML page with label <APPLET>. See other source of information for how to write HTML. An example of a HTML page:
            <TITLE> Mocha TN3270 example </TITLE>
            <APPLET CODE="tn3270.class" ARCHIVE="tn3270.jar"
                WIDTH="800" HEIGHT="500" scriptable="true">
            <param name="host" value="myibmmainframeip">
            <param name="port" value="23">
            <param name="ssl" value="false"
            <param name="tn3270e" value="true">
            <param name="luname" value="">
            <param name="keylayout" value="">
            <param name="32x80" value="true">
            <param name="ebcdic" value="37">
            <param name="autoconnect" value="false">
            <param name="user" value="">
            <param name="password" value="">
            <param name="license" value="">
            <param name="license_key" value="">
            <param name="hotspots" value="true">
            <param name="font" value="Courier New">
            <param name="fontstyle" value="Plain">
            <param name="margin" value="36">
            <param name="tool_bar" value="true">
            <param name="menu_bar" value="true">
            <param name="show_fxx" value="true">
            <param name="negotiate" value="false">
            <param name="debug" value="false">
            <param name="color_bg" value="#000000">
            <param name="color_cursor" value="#FFFFFF">
            <param name="color_select" value="#808080">
            <param name="color_red" value="#FF0000">
            <param name="color_blue" value="#5E98FE">
            <param name="color_pink" value="#FF00FF">
            <param name="color_green" value="#00FF00">
            <param name="color_turquoise" value="#00FFFF">
            <param name="color_yellow" value="#FFFF00">
            <param name="color_white" value="#FFFFFF">
            <param name="keylayout" value="default">
            <param name="keepalive" value="false">
            <param name="show-f1-f12" value="true">
            <param name="show-f13-f24" value="false">
            <param name="show-extra" value="true">
            <param name="2xclick" value="false">
            <param name="nodialog" value="false">
            <param name="numeric" value="true">
            <param name="beep" value="true">
            <param name="hideviewmenu" value="false">
            <param name="hideoptionmenu" value="false">
            <param name="smallconnectdialog" value="false">
CODE parameter must always be "TN3270.class". It is the name of the master file for the binary Mocha TN3270 product. To use the full width use "100%"

Each parameter is build of a name and a value. In the example above parameter host is given value unix. It is very important to remember <> around each line, and the value must be surrounded with "".

As to give keyboard focus to the applet when loaded add a small script:

            <script type="text/javascript">
            onload = function()
            document.getElementsByTagName( "APPLET" )[0].focus();

2.2 Parameter keylayout

It is possible to define a keyboard mapping, such as what shift + f5 should do in a customized file. If "default" is used, a default file included in the jar file will be used. If a filename as "keys32" is given, this file must exist in the same folder on the Web server, as the TN3270.jar file.


  name=keylayout value="<a file name>"

2.3 Parameter license

Name of the company using Mocha TN3270. Should only be included together with parameter "license_key".


  name=license value="<name of a company>"

2.4 Parameter license_key

When ordering Mocha TN3270, an encrypted license code will be received. Use this together with parameter "license" to remove the time limit for a session. The license key for the Java version start with "E". A license key for another MochaSoft product cannot be used.


  name=license_key value="<encrypted key>"

2.5 Parameter user and password

Use these two options to perform auto login, when the applet is loaded. Of course it can not be recommended to include a secret login and password in a HTML page, as everyone can read the source from a browser.

  name=user value=<userid>
  name=password value=<password>


  name=user value="joe"
  name=password value="password"

2.6 Parameter ebcdic

The EBCDIC codepage should be the same as on the IBM Mainframe. Following values are supported


  name=ebcdic value="codepage number"


  name=ebcdic value="277"

2.7 Parameter hotspots

If it should be possible to click on keys displayed on the screen, such as F3=exit. Also URLS starting with www. , http:// or https:// can be clicked


  name=hotspots value="true | false"

 Default is false.

2.8 Parameter show-f1-f12

If toolbar should include keys f1 - f12


  name=show-f1-f12 value="true | false"

 Default is true.

2.9 Parameter show-f13-f24

If toolbar should include keys f13 - f24


  name=show-f13-f24 value="true | false"

 Default is false. Press shift and f1-f12 becomes f13-f24.

2.10 Parameter show-extra

If toolbar should include extra 3270 keys, such as clear


  name=show-extra value="true | false"

 Default is true.

2.11 Parameter 2xclick

A double click put the cursor at the position, and send a 3270 ENTER command to the server.


  name=2xclick value="true | false"

 Default is true.

2.12 Parameter nodialog

A click on menu - connect or toolbar connect icon, will not display the dialog for the IP address and other information, but a new session is started to the IBM Mainframe using the IP address from the HTML page.


  name=nodialog value="true | false"

 Default is false.

2.13 Parameter numeric

If 3270 should make a numeric input check for fields defined as numeric only


  name=numeric value="true | false"

 Default is true.

2.14 Parameter tn3270e

If tn3270 should use the tn3270e protocol. It gives better SYSREQ support and allows a fixed luname for the session.


  name=tn3270e value="true | false"

 Default is true.

2.15 Parameter luname

If tn3270 should use a fixed LUNAME. The name must be configured on the server, otherwise, the session will be rejected. In most cases this parameter should not be used.


  name=tn3270e value="a luname"

2.16 Parameter beep

if bell should be allowed


  name=beep value="true | false"

 Default is true.

2.17 Parameter hideviewmenu

If the menu bar element "view" should be displayed.


  name=hideviewmenu value="true | false"

 Default is false.

2.18 Parameter hideoptionmenu

If the menu bar element "options" should be displayed.


  name=hideoptionmenu value="true | false"

 Default is false.

2.19 Parameter smallconnectdialog

If the connect dialog should only have ip, port and ssl/tls option displayed


  name=smallconnectdialog value="true | false"

 Default is false.

2.20 Parameter tool_bar

Defines if the toolbar below the menu bar showuld be shown.


  name=tool_bar value="true | false"

 Default is true.

2.21 Parameter menu_bar

Defines if the menu bar should be shown.


  name=menu_bar value="true | false"

 Default is true.

2.22 Parameter show_fxx

Defines if the f1 - f24 and extra keys keys should be in the tool bar.


  name=show_fxx value="true | false"

 Default is true.

2.23 Parameter color_bg

The color of the background can be defined with this parameter.


  name=color_bg value="#rrggbb"


The syntax is the same as used in the HTML language.


  name=color_bg value="#20f030"

2.24 Parameter color_xxx

The colors the IBM Mainframe program request, can be defined with this parameter.

  name=color_red value="#rrggbb"
   name=color_blue value="#rrggbb"
   name=color_pink value="#rrggbb"
   name=color_green value="#rrggbb"
   name=color_turquoise value="#rrggbb"
   name=color_yellow value="#rrggbb"
   name=color_white value="#rrggbb"


The syntax is the same as used in the HTML language.

2.25 Parameter color_select

The color used to mark an area for clipboard copy can be defined with this parameter.


  name=color_select value="#rrggbb"


The syntax is the same as used in the HTML language.

2.26 Parameter color_cursor

The color of the cursor can be defined with this parameter.


  name=color_cursor value="#rrggbb"

The syntax is the same as used in the HTML language.

2.27 Parameters host and port

These parameters defines which host to connect, when the applet is loaded. The default port number for TN3270 is 23.

  name=host value=<a host name>
  name=port value=<number>

The host name can either be a name or an internet address as There is not a real server at this address!

2.28 Parameter SSL

Mocha TN3270 can use SSL/TLS layer from the SUN Java layer.


  name=SSL value="true | false"

 Default is false

2.29 Parameter autoconnect

Mocha TN3270 can make a connection when the applet has been loaded.


  name=autoconnect value="true | false"

 Default is false

2.30 Parameter 32x80

Mocha TN3270 screen sizee can be 24x80 or 32x80. TN3270 will always start in 24x80 mode, but an IBM Mainframe application can request for 32x80 mode, if this parameter is true.


  name=32x80 value="true | false"

 Default is false

2.31 Parameter font and font style

Possible to define the display font

  name=font value="font name"
  name=fontstyle value="style"

Default is Courier. To see the font names possible to use, start mocha TN3270 in a browser, and select menu - settings - font.

Possible font styles are :Plain,Bold, Italic and Bold Italic.

2.32 Parameter keepalive

TN3270 can send keep alive frames at 10 second intervals.


  name=keepalive value="true | false"

 Default is true

2.33 Parameter margin

Margin to be used around a screen print


  name=margin value="36"

 Default is 36

3.0 Keyboard mapping

As it is individual how to map the keyboard, all function keys has been made changeable. If parameter "keylayout" is not used or defined as default, a standard keyboard mapping file from the TN3270.jar file will be used. See 3.1

The package includes an example keyboard file keys32, which can be used with parameter "keylayout".

Syntax for file "keys32.txt":

Following keys can be defined:

The pc-key's are:
fxx : xx is 1 .. 24 (function key f1 - f12)
Fxx : xx is 1 .. 24 (shift + function key f1 - f12)
cfxx : xx is 1 .. 24 (ctrl + function key f1 - f12)
CFxx : xx is 1 .. 24 (shift + ctrl + function key f1 - f12)

The 3270 keys are:

pf1 - pf24
erase (erase all input fields)
begin(goto the start of the current field)
end(goto end of the current field)
clear (send clear request to the host)
reset (reset keyboard)
previous jump to the previous field
next jump to the next field

Example of a "keys" file:

            # TN3270  keymap
            # f1 = f1 key , F1 = shift F1
            # cf1 = f1 + ctrl  CF1 = shift f1 + ctrl
            # <pc - key>  <3270 key>
            f1   pf1
            f2   pf2
            f3   pf3
            f4   pf4
            f5   pf5

3.1 Default keyboard

The default file "keys", contains following mapping of the keyboard:

            pc-Key       3270-key       pc-key              3270-key
            -----------------------      -----------------------------
            f1              PF1          crtl f1              pa1
            f2              PF2          ctrl f2              pa2
            f3              PF3          ctrl f3              pa3
            f4              PF4          ctrl f4              ATTN
            f5              PF5          ctrl f5              SYSREQ
            f6              PF6          ctrl f6              INSERT
            f7              PF7          ctrl f7              ERASE INPUT
            f8              PF8          ctrl f8              DUP
            f9              PF9          ctrl f9              FM
            f10             PF10         ctrl f10             -
            f11             PF11         ctrl f11             -
            f12             PF12         ctrl f12             -
            pc-Key       3270-key       pc-key              3270-key
            -----------------------      -----------------------------
            shift f1        PF13         crtl shift f1        CLEAR
            shift f2        PF14         ctrl shift f2        RESET
            shift f3        PF15         ctrl shift f3        BEGIN
            shift f4        PF16         ctrl shift f4        END
            shift f5        PF17         ctrl shift f5        -
            shift f6        PF18         ctrl shift f6        -
            shift f7        PF19         ctrl shift f7        -
            shift f8        PF20         ctrl shift f8        -
            shift f9        PF21         ctrl shift f9        -
            shift f10       PF22         ctrl shift f10       -
            shift f11       PF23         ctrl shift f11       -
            shift f12       PF24         ctrl shift f12       -

            pc-Key       3270-key
            HOME         BEGIN
            END          END
            PGUP         PREVIOUS
            PGDN         NEXT
            ESC          RESET KEYBOARD
            RETURN       ENTER
            CTRL         RESET

4.0 License System

The license system for Mocha TN3270 is very user friendly. The encrypted parameter "license_key", together with parameter "license" gives a check for legal use. It is not possible to change the company name in "license", without ordering a new key from MochaSoft.

If parameter "license_key" is not given, the program will run in Demo mode, and a session is restricted to 180 seconds