Configure a Web Server for Uniface Applications

Uniface automatically installs the Apache Tomcat Web Server, which is used for developing testing Uniface web applications and web services. In a production environment, you can use Tomcat as the web server for your deployed application, but you can use any Java EE (Enterprise Edition) compliant web server with support for the Servlet 3.0 specification or higher.

If you are not using the default development installation, or your are using another web server for deployment, you need to configure your web server to run the Java servlets provided by Uniface.

Most Java EE web servers have an administrator console or other tools for configuring the servlet engine and deploying applications. Servlet definitions and parameters may be specified in an ASCII file or through the user interface, depending on the servlet engine. For details, refer to the documentation of your web server and servlet engine. The following instructions are general guidelines.

Tip: Get the values you need to define the servlets in your environment from the web.xml file in UnifaceInstallDir/uniface/webapps/uniface/WEB-INF.

To configure a web server to use the Uniface servlets:

  1. Using the web server tools, provide the location of the servlet jar file wrd.jar. This is located in UnifaceInstallDir/common/tomcat/common/lib.

    The Java Virtual Machine must know where the servlet .jar file is located. This information is normally provided in the CLASSPATH environment variable, but some servlet engines provide their own way to specify the location.

  2. Define the servlets in an ASCII file or through the user interface, depending on the servlet engine. The servlet engine must know that the servlet exists.
  3. Edit the servlet parameters for each servlet.

    The default values are available in web.xml but you can set others. For more information, see Configuration Settings: Uniface Servlet.

    1. Ensure that the MIDDLEWARE parameter of each servlet is set, providing the server name, and the name and password used to run the Uniface Server process. For example:
      <init-param>
        <param-name>MIDDLEWARE</param-name>
        <param-value>UV8:firefly.nl.myorg.com|UnifaceServer|Uniface_Server123|wasv</param-value>
      </init-param>
    2. Optionally, set the TESTABLE servlet parameter to true. For example:
      <init-param>
         <param-name>TESTABLE</param-name>
         <param-value>true</param-value>
      </init-param>

      This setting makes it possible to display a test page to confirm that the servlet is running.

      Note:  This should only be set to true during configuration and testing. In a production environment, it should be removed or set to false.

  4. Stop and restart the web server to have the new servlets and settings take effect.
  5. Test that the web server can connect to Uniface.

    For example, if the TESTABLE servlet parameter is true, you can enter the URL of the Uniface test page (Uniface Test Middleware Response):

    • If the servlet setting USERUNPREFIX is false (default): http://ServerHost/uniface/wrd/WRD_Version
    • If the servlet setting USERUNPREFIX is true: http://ServerHost/uniface/wrd/run/WRD_Version

    For example: http://firefly.nl.myorg.com/uniface/wrd/WRD_Version

    The test page should be displayed, providing the WRD version number, the minimum Java Servlet API required, the Uniface build name and date.

    Uniface Test Middleware Response Page

    Graphical content.

    If this page is not displayed, there is likely to be a problem with the configuration. For troubleshooting assistance, see Uniface WRD Configuration Errors.

    If this page is displayed correctly, remove the TESTABLE servlet setting from the web.xml file, then stop and restart the web server.

Related Topics