Created by Ming Zhu
In this blog we will explain how you install Apache Tomcat 10.1 with WRD 7.0 deployed, and how to make these work in your Uniface environment. In an earlier blog [R1] we announced that Uniface now supports all the Servlet-6.0-compliant Web application servers, like Apache Tomcat 10.1. We also explained how to use the SameSite=Strict cookie attribute in your WRD (Web Request Dispatcher) version 7.0.
With the current Uniface 10.4.02 installation package, Apache Tomcat 9 and WRD 6.4 are installed by default. As of Uniface release 10.4.02.017, the WRD 7.0 jar file will be copied into the sub directory uniface/webapps/uniface/WEB-INF/lib_wrd/v7/wrd.jar so that you can start using it.
Requirements for this installation
To install WRD 7.0, the following requirements need to be met:
- JDK 11 or higher,
- Apache Tomcat 10.1.0 or higher.
Procedure for the Tomcat 10.1 and WRD 7.0 installation
Follow these steps to install and configure Tomcat 10.1 with WRD 7.0 for your Uniface environment on Windows and Unix platforms:
- Install Java 11 Runtime Environment (JRE11).
- Install Apache Tomcat 10.1
- Install Uniface WRD 7.0
- Configure Tomcat 10.1 and WRD 7.0 for your Uniface Web application.
- If you have already installed JRE11 or higher, you can go directly to step 2.
- If you have already installed Tomcat 10.1 or higher, you can go directly to step 3.
Step 1. Install JDK 11 or higher
1.1. First, download a Java SE Development Kit (JDK) version 11 or later from:
1.2. Install the JDK (or JRE) according to the instructions included with the release.
You may also use a Java SE Runtime Environment (JRE) rather than a JDK.
Step 2. Install Apache Tomcat 10.1
Suppose the home directory of your Tomcat 10.1 installation is TOMCAT10_HOME, then:
2.1. Download a binary distribution of Tomcat 10.1 or higher from:
Apache Tomcat® - Apache Tomcat 10 Software Downloads https://tomcat.apache.org/download-10.cgi
2.2. Unpack the binary distribution so that it resides in its own directory (conventionally named "apache-tomcat-10.1").
For the purposes of the remainder of this document, we use the name "CATALINA_HOME" to refer to the full path name of that directory.
2.3. Configure Environment Variables:
Tomcat is a Java application and does not use environment variables directly. Environment variables are used by the Tomcat startup scripts. The scripts use the environment variables to prepare the command that starts Tomcat.
2.3.1. Set CATALINA_HOME:
The CATALINA_HOME environment variable should be set to the location of the root directory of the "binary" distribution of Tomcat.
The Tomcat startup scripts have some logic to set this variable automatically if it is absent, based on the location of the startup script in Unix and on the current directory in Windows. That logic might not work in all circumstances, so we recommend that you set the variable explicitly.
2.3.2. Set JRE_HOME or JAVA_HOME (required):
These variables are used to specify the location of a Java Runtime Environment or a Java Development Kit that is used to start Tomcat.
The JRE_HOME variable is used to specify the location of a JRE. The JAVA_HOME variable is used to specify the location of a JDK.
Using JAVA_HOME provides access to certain additional startup options that are not allowed when JRE_HOME is used.
If both JRE_HOME and JAVA_HOME are specified, JRE_HOME is used.
The recommended place to specify these variables is a "setenv" script.
2.4. Start your Tomcat 10.1 server:
Suppose the port of your Tomcat 10.1 is 8080, then verify the page by navigating to http://localhost:8080.
You should see the Tomcat start page if everything is ok.
For details and all optional configuration, see the related Tomcat documents [R2, R3].
Step 3. Install WRD 7.0
3.1. Download the patch release 10.4.02.017 (or higher) and install it.
3.2. Suppose your UNIFACE installation folder is UNIFACE_HOME:
Copy UNIFACE_HOME\uniface\webapps\uniface\WEB-INF\lib_wrd\v7\wrd.jar into TOMCAT10_HOME\lib\
Step 4. Configure Tomcat 10.1 and WRD 7.0 for your Uniface Web application
Suppose your Uniface Web application is located at UNIFACE_HOME\uniface\webapps\uniface.
4.1. Make a copy of this application and rename it as
4.2. Edit the file UNIFACE_HOME\uniface\webapps7\uniface\WEB-INF\web.xml :
4.2.1. Replace all Java package name "com.compuware" with "com.rocketsoftware". For further configuration of this web.xml including the DEFAULTSAMESITE setting, please refer to [R1, R4.1, R4.3].
4.2.2. Optionally, we suggest you update your configuration for servlet
com.rocketsoftware.uniface.urd.WRDServlet and add a new init-param DEFAULTSAMESITE with value LAX
With this setting, the SameSite attribute with the value set to LAX will be added to all cookies in the user's Uniface Web application. This will protect your application from some types of cross-site request forgery (CSRF) attacks. See [R1], [R4.3] for details.
4.3. Inside the directory TOMCAT10_HOME\conf\Catalina\localhost, create a new file with the name uniface.xml and with the following content:
Please refer to [R4.2] for setting the default value of the SameSite cookie of the Tomcat Web container.
4.4 Stop your existing Tomcat 9 (if you have one), and restart your Tomcat 10.1 and Uniface's Urouter;
Now Tomcat 10.1 with WRD 7.0 is ready for you to use.
Take action to secure your Web applications
We strongly suggest that you migrate your Web application to WRD 7.0 on a Servlet-6.0-compliant server like Tomcat 10.1 and start using the SameSite cookie feature to secure your Web application.