Test Server Environment Setup

Before you can execute a Nexacro Platform application directly on a web browser, you need to create and test an operating environment for each browser you want to support. This can be done with the Windows Runtime architecture or on Nexacro Studio.

To run Nexacro Platform applications, you only need a web server. Choose a web server based on your particular needs. The following table compares two popular web servers, Mongoose and Apache Tomcat.


If you want to test data transactions, you should also install a web application server (WAS). Refer to Running Apache to Test Data Transactions.

Feature

Mongoose

Apache Tomcat

Installation file

None

The executable is unpacked and ready to run.

Installation file provided

You must install the web server before you can use it.

JDK Installation

Not required

Separate JDK installation required

Contexts

None

The folder where the executable is located is the web server root.

Create contexts using the Apache interface or by deploying a war file.

X-API support

Not available

Available through separate installation

XPLATFORM 9.2

Not available

Version 9.2 requires JSP

Available

For more information about various web servers, refer to the vendor's documentation.

Using Mongoose

Use Mongoose, a lightweight web server, to test the Nexacro Platform application without testing data transactions.

Mongoose does not require installation. Simply copy the executable file to your computer and run it.

Download Web Server Software

Download the Mongoose executable for your environment from Google: https://code.google.com/p/mongoose/

Copy the downloaded file to the Generate Path that you specified in Nexacro Studio (Options > Generate path). Nexacro Studio creates the application JavaScript code in the designated folder.

Run the Web Server

  1. Double-click the Mongoose executable file to run Mongoose.

  2. Right-click the Mongoose icon in the system tray to interact with the web server. (Refer to the Mongoose documentation at http://cesanta.com/docs.shtml for more information.)

  3. Selecting Start browser opens the web browser. (The Mongoose executable file appears as the web server's root.)

The directory list varies depending on the Mongoose version that you are using.

Test the Application

You can test Nexacro Platform by clicking the newly created project directory (Hello).

To execute an application through a web browser directly in Nexacro Studio, select the web browser on the build toolbar and enter the following URL:

http://127.0.0.1:8080/Hello/index.html

To shut down the web server, right click on the Mongoose icon and select Exit.

Running Apache to Test Data Transactions

To test applications as well as test data transactions, you will need to install a web application server (WAS). You can use a free application, such as Tomcat, Jetty, or Winstone, or a commercial application. This section illustrates how to install Apache Tomcat and the required Java SE Development Kit (JDK).

Installing the JDK(Java SE Development Kit)

Tomcat is a Java-based program and requires the Java SE Development Kit (JDK) to run. The JDK is distributed by Oracle Software.

  1. Download the JDK for your environment from Oracle via this URL:

http://www.oracle.com/technetwork/java/javase/downloads/index.html

If you are running Windows,download the 32- or 64-bit JDK that matches your operating system.

  1. Run the downloaded installation file to automatically install and configure the JDK.

  1. You can use the command line interface to confirm that Java has installed successfully with the following command:

java -version

When installing JDK version 1.5 and later, you can access the system path by copying execution files without setting up the environment variables (Java_Home) needed for execution.

Installing Apache Tomcat

  1. Download the version of Tomcat appropriate for your environment from the following URL:

http://tomcat.apache.org

Depending on the environment, Tomcat may execute a binary file directly or use a separate installation file. This section assumes you are using an installation file.

  1. Run the downloaded file, the installation wizard leads you through the installation process and automatically locates your JRE path.

Testing your Tomcat Installation

  1. Once Tomcat has been installed, it registers as a Windows service and starts the web server. In the System tray, right click on the Tomcat icon to view status information or to make configuration changes.

  1. In your web browser, enter the following URL to confirm that the server has installed successfully.

http://127.0.0.1:8080

Adding Context

To execute an application on Tomcat, you must add context. Although there are several ways to add context, this chapter discusses ways to set up context under the webapps folder and under a temporary folder.

Depending on your operating system configuration, you may need system administrator privileges to add or edit files. Nexacro Studio requires administrator privileges to add an application to your webapps configuration.

Webapps Set-up

The webapps folder is subordinate to the Tomcat installation folder. In a default installation, it is located in this path:

C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps\
  1. In Windows Explorer, add a new folder under the webapps folder. And then, add another folder named "WEB-INF".

  1. Using a text editor, create a file in the WEB-INF folder named web.xml. Paste the following content in web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
  http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
  version="3.0"
  metadata-complete="true">
</web-app>

Once you set the Options > Generate path, Nexacro Studio creates application JavaScript code in the specified folder.

Adding External Context

Apache webapps setup is limited to a predetermined path. To use a different folder (for example, on a Windows D: drive), you must use an external context. To do this, add an application context file (created in the form of a XML file) to a designated folder under the path where Tomcat is installed.

C:\Program Files\Apache Software Foundation\Tomcat 7.0\conf\Catalina\localhost

Create an XML file with a name of your choice and add the following content.

<Context path="/Hello" docBase="D:\03_TEST\XP\BUILD\Hello"
  debug="0" prvileged="true" reloadable="true">
  <Logger className="org.apache.catalina.logger.FileLogger"
    directory="logs" prefix="localhost_log." suffix=".txt"
    timestame="true"/>
</Context>

Testing Your Nexacro Platform Application

Test your Nexacro Platform application by:

  1. Entering that application's path in your web browser, or

  2. Directly from the web browser in Nexacro Studio by clicking Web Browser on the build toolbar, and enter the following URL:

http://localhost:8080/Hello/index.html

To shut down the web server, right-click on the Tomcat icon and select Exit.