Java Samplecode

The following Java-based sample applications are provided:

Application Description
Console A console-based Java application that connects to a host session, creates a screen object, sends data to the host, and receives events. This application is designed to handle more than one session.

You must do the following to run the sample application:

  1. Create one or more configuration files in the folder <Installation Location>\samples\xml, and name them DemoConfig1.xml through DemoConfign.xml (with n being equal to the number of sessions you plan to open).

    You may create your own or use one of the provided sample configuration files as long as you modify it by replacing the host address, terminal ID, terminal address, etc. with values appropriate to your host.

    Note This application uses specific configuration file names in order to allow you to open multiple sessions without rewriting the sample code. For this reason, you must name the configuration file(s) as specified.
  2. Add the SDK .jar files to your classpath, and run SDKConsoleDemo.

    See Using the Verastream SDK with Eclipse for directions.

The application will ask how many sessions to open, and you will use the configuration files you created to open the sessions.

Location: <Installation Location>\samples\Java\Console

JSP A JSP application that demonstrates how to connect to the host from a JSP page. The application captures a terminal emulation screen and sends it to the browser via HTML.

In order to use this application, you must modify the source code to point to a valid configuration file on your web application server (one that you created, or a sample configuration file that you have modified with your connection information).

Note This sample is to be deployed as a web application, so the SDK must be installed on your web server in order for this sample to work properly.

Location: <Installation Location>\samples\Java\JSP

Servlet This application demonstrates how to develop an SDK servlet. It opens a host connection and sends the first screen of data from the host to the terminal via HTML.

In order to use this application, you must modify the source code to point to a valid configuration file on your web application server (one that you created, or a sample configuration file that you have modified with your connection information).

Note This sample is to be deployed as a web application, so the SDK must be installed on your web server in order for this sample to work properly.

Location: <Installation Location>\samples\Java\Servlet

For more information on creating XML configurations, see Defining an XML Configuration.

Related Topics
ActiveX Technologies Supported
Development Tools Supported
Deploying SDK Applications in Tomcat Environments
  Footer