Configuring web.xml
The web.xml
file contains a number of tags that define both servlets and their behavior. The web.xml
file is located in the virtualviewer\WEBINF
directory. There are two groups of tags. The first group is a pair of
All of these tags are now added by default to VirtualViewer HTML5 for Java
web.xml when the contentServerType
parameter is set to integrated.
Retrieval Servlet
The first <servlet>
is the Response Server, which is responsible for handling when data needs to be sent to VirtualViewer HTML5 for Java. Various
parameters within its tag define where to retrieve documents from, how it
should render and deliver them to VirtualViewer HTML5 for Java, how to
cache documents, logging, and more.
<servlet>
<servlet-name>RetrievalServet</servlet-name>
<servlet-class>com.snowbound.snapserv.servlet.ResponseServer</servlet-class>
<init-param>
<param-name>contentHandlerClass</param-name>
<param-value>com.snowbound.snapserv.servlet.FileContentHandler
</param-value>
</init-param>
<init-param>
<param-name>logLevel</param-name>
<param-value>FINE</param-value>
</init-param>
</servlet>
Upload Servlet
The second <servlet>
is the Request Server. It is responsible for handling
when data needs to be sent from VirtualViewer HTML5 for Java. Various
parameters within its tag define settings for the servlet when saving documents and annotations.
<servlet>
<servlet-name>UploadServer</servlet-name>
<servlet-class>com.snowbound.snapserv.servlet.RequestServer</servlet-class>
<init-param>
<param-name>saveAnnotationsAsXml</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>tmpDir</param-name>
<param-value>c:/tmp/</param-value>
</init-param>
</servlet>
Defining the Servlet Paths
Each servlet has its own <servlet-mapping>
tag to define the path it
may be found. The default values should not be changed.
<servlet-mapping>
<servlet-name>RetrievalServlet</servlet-name>
<url-pattern>/ResponseServer</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>UploadServlet</servlet-name>
<url-pattern>/RequestServer</url-pattern>
</servlet-mapping>
Have questions, corrections, or concerns about this topic? Please let us know!