You have obtained an installation package for EEvision. Within the package, the files for a web server installation are located in the directory web/. The sub-directory web/srv/ contains the needed CGI programs, the directory web/img the images that are referenced by EEvision. An example EDB vehicle.edb plus accompanying SVG images is contained in the directory web/data/.
We assume that EEvision should be installed in the sub-directory webapps/eevision of the Jetty base directory. In the following $eev/ denotes this directory. Copy the contents of web/ with the exception of web/srv/ to the EEvision installation directory $eev. Create sub-directories $eev/WEB-INF/ and $eev/WEB-INF/cgi. Copy the contents of the directory web/srv/ to $eev/WEB-INF/cgi/.
<servlet id="cgi"> <servlet-name>cgi</servlet-name> <servlet-class>org.eclipse.jetty.servlets.CGI</servlet-class> <load-on-startup>1</load-on-startup> <async-supported>true</async-supported> <init-param> <param-name>cgibinResourceBase</param-name> <param-value>WEB-INF/cgi</param-value> </init-param> <init-param> <param-name>cgibinResourceBaseIsRelative</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>commandPrefix</param-name> <param-value></param-value> </init-param> <init-param> <param-name>ENV_LM_LICENSE_FILE</param-name> <param-value>Path of the license file</param-value> </init-param> <init-param> <param-name>ENV_EEV_DATA</param-name> <param-value>../../data</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>cgi</servlet-name> <url-pattern>/s>v/*</url-pattern> </servlet-mapping>
EEvision requires that the execution of CGI programs is enabled in Jetty. However, by default the CGI servlet is disabled. We assume that the CGI-Programs are located in the $eev/WEB-INF/cgi sub-directory of the EEvision installation. For Jetty, the module servlets needs to be loaded at startup. Additionally inserting the contents of the gray box into $eev/WEB-INF/web.xml file enables the execution of CGI programs in the $eev/WEB_INF/cgi directory. Note that we need to specify the location of the data directory, which contains all EDB files and their accompanying SVG image files. To do so, we set the environment variable EEV_DATA to “../../data”. This value is the relative path (w.r.t. the CGI programs) to $eev/data, where we copied the provided example EDB. For more information, please refer to your Jetty documentation.
file name extension |
mime type | default | ||
---|---|---|---|---|
compress | ||||
.html | text/html | ✓ | ✓ | |
.css | text/css | ✓ | ||
.js | application/javascript | ✓ | ||
.svg | image/svg+xml | ✓ | ✓ | |
.png | image/png | ✓ | ||
.gif | image/gif | ✓ | ||
.wasm | application/wasm | ✓ | ||
.json | application/json | ✓ | ||
.conf | application/json | |||
.sym .nlv | text/x-nlv | ✓ | ||
CGI Programs responses |
text/plain | |||
application/json |
Most of these mime types already map to the file name extensions by default on most Web Servers (checked in the “default” column) and if so, they don't need to be additionally declared. In Jetty, data compression can be activated by activating the GZIP handler (from the gzip module). For configuration options, see the file etc/jetty-gzip.xml in the Jetty installation directory.
<init-param> <param-name>cacheControl</param-name> <param-value>max-age=30</param-value> </init-param>
There are cache control strategies that delivers an expiration date to the Browser to make them silently caching the contents until it expires (some Browsers do, others don't). This expiration time should not be set too long, because there is no easy way to update the Browser before those resources expire. For Jetty, browser caching can either be controlled in the global configuration file at etc/webdefault.xml by adding the configuration parameter shown in the gray box on the right side to the declaration of the DefaultServlet. Alternatively, one can copy the declaration of the DefaultServlet to the $eev/WEB-INF/web.xml file and add the parameter there. This will set this expiration date to 30 seconds after access.
<welcome-file-list> <welcome-file>fileselect.html</welcome-file> </welcome-file-list>If you want to make a certain html file your start page, you can define that to Jetty as shown in the box on the right side – to be put into $eev/WEB-INF/web.xml. If so, Jetty will deliver the fileselect.html (a simple file selection page) on the start URL http://server/eevision.
Copyright © 2020–2024 by Altair Engineering Inc.
All rights reserved.