A
web.xml file
defines settings that are used in a Java web application. The
web.xml file
must be placed in the
WEB-INF directory of your web application. The root element in the
file must always be
<web-app>. The following settings can be added to your
web.xml file.
Web.xml setting reference table
| |
| Sets the view type of the report view
pane.
|
| Allows you to display exception information
|
| Allows you to log exception information
|
| Sets the location of the
crystalreportsviewers directory in
your web application
|
| Sets the interpretation of the
crystal_image_uri to be relative to
the web page, application, or server
|
| Sets the default number of values that will
be returned in a list.
|
| Enables the Report Processing Indicator
|
| Modifies the text displayed by the Report
Processing Indicator
|
| Enables asynchronous requests.
|
| Allows you to view the parameter panel in
your web application, handles report exporting, interactive parameters, images,
and charts
|
| Enables the use of JavaServer Faces (JSF)
components in your web application
|
crystal_document_view
Sets the view type of the report view pane. The
crystal_document_view parameter value
can be set to one of the following values:
printlayout - Displays a grey
background behind the report with a dropdown shadow cast by the report page.
Shows the page layout of the report when printed.
weblayout - Fills the entire report
view pane with the report. There is no grey background.
Note: If the crystal_document_view parameter is
not specified, it is set to
printlayout by
default.
<context-param>
<param-name>crystal_document_view</param-name>
<param-value>weblayout</param-value>
</context-param>crystal_exception_info
Allows you to display exception information. If
you do not display exception information you can still log the exception
information if you use the
crystal_exception_log_file
setting. The
crystal_exception_info parameter value
can be set to one of the following values:
short - Displays the exception
information without the accompanying stack trace.
long - Displays the exception
information with the accompanying stack trace.
disable - Exception information is not
displayed. The user must handle the exception.
Note: If the
crystal_exception_info parameter is
not specified, it is set to
short by default.
<context-param>
<param-name>crystal_exception_info</param-name>
<param-value>long</param-value>
</context-param>crystal_exception_log_file
Allows you to log exception information. The
parameter value specifies the location of the log file. Regardless of the
setting of the
crystal_exception_info parameter, the
exception information output to the log file will be in the long format.
Note: By default, exceptions are not logged.
<context-param>
<param-name>crystal_exception_log_file</param-name>
<param-value>c:\temp\webreportingexception.log</param-value>
</context-param>crystal_image_uri
Sets the location of the
crystalreportsviewers directory in
your web application. This setting must be included in the web.xml file if you
are using a report viewer in your web application. The
crystalreportviewers
directory contains all files required by the viewer.
<context-param>
<param-name>crystal_image_uri</param-name>
<param-value>/web_application_name/crystalreportviewers</param-value>
</context-param>crystal_image_use_relative
Sets the interpretation of the
crystal_image_uri to
be relative to the web page, application, or server. The parameter value can be
set to one of the following values:
webapp - Sets the uri as relative to
the web application directory.
server - Sets the uri as relative to
the server root.
Page - Sets the uri is relative to the
page from which the resources in the crystalreportviewers directory are
requested.
<context-param>
<param-name>crystal_image_use_relative</param-name>
<param-value>webapp</param-value>
</context-param>crystal_max_number_parameter_default_values
By default, the Java DHTML viewers return a
maximum of 200 values per list at a time. The
crystal_max_number_parameter_default_values
parameter value overrides this default size. If a list exceeds the default size
of 200, or the number set by this parameter, a link to the remaining values is
displayed.
<context-param>
<param-name>crystal_max_number_parameter_default_values</param-name>
<param-value>100</param-value>
</context-param>
crystal_processing_indicator_delay
The Report Processing Indicator will present
specific feedback regarding both general processing status and print processing
status. By default, the Report Processing Indicator will display for any
postback action longer than 500 ms. The
crystal_processing_indicator_delay
parameter value overwrites the default delay of 500 ms. You
can specify any non-negative number in milliseconds. When the parameter value
is set to 0, the report processing indicator is disabled.
Note: This feature works only when using a Java
DHTML viewer. This feature is currently implemented only for Internet Explorer
browsers.
<context-param>
<param-name>crystal_processing_indicator_delay</param-name>
<param-value>0</param-value>
</context-param>
<context-param>
<param-name>crystal_processing_indicator_text</param-name>
<param-value>some text</param-value>
</context-param>crystal_processing_indicator_text
The Report Processing Indicator will present
specific feedback regarding both general processing status and print processing
status. The
crystal_processing_indicator_text
parameter value modifies the text displayed by the Report
Processing Indicator.
Note: This feature works only when using a Java
DHTML viewer. This feature is currently implemented only for Internet Explorer
browsers.
<context-param>
<param-name>crystal_processing_indicator_delay</param-name>
<param-value>0</param-value>
</context-param>
<context-param>
<param-name>crystal_processing_indicator_text</param-name>
<param-value>some text</param-value>
</context-param>crystal_use_asynchronous_requests
By default, asynchronous requests are permitted
within the DHTML viewer. If you wish to enable the
Back button
in the user's browser to work with the DHTML viewer, you must disable
asynchronous requests by setting this parameter to
false.
Note: It is recommended that you do not set the
crystal_use_asynchronous_requests
parameter to
false. Doing so will
disable some viewer performance enhancemenets and enhanced appearance features.
<context-param>
<param-name>crystal_use_asynchronous_requests</param-name>
<param-value>false</param-value>
</context-param>
CrystalReportViewerServlet
The CrystalReportViewerServlet allows you to view
the parameter panel in your web application. The servlet allows the Java DHTML
viewers to export and print when the viewers are embedded in other content. The
servlet also handles interactive parameters, images, and charts. This setting
must be included in the web.xml file if you are using a report viewer in your
web application.
<servlet>
<servlet-name>CrystalReportViewerServlet</servlet-name>
<servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CrystalReportViewerServlet</servlet-name>
<url-pattern>/CrystalReportViewerHandler</url-pattern>
</servlet-mapping>Faces Servlet
Enables the use of JavaServer Faces (JSF)
components in your web application. This setting must be included in the
web.xml file if you are using JSF components or beans in your web application.
load-on-startup - When the value is
set to 0, the servlet does not load on startup. When the value is set to 1, the
servlet loads on startup.
url-pattern – Sets the path to the
Faces Servlet.
javax.faces.application.CONFIG_FILES
parameter value – Sets the location of the faces-config.xml file. You must
create this file when setting up a JSF project. For more information see:
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.application.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>Example: Basic web.xml file
You must change the following parameters:
display-name - Name of your web
application.
crystal_image_uri parameter value -
Location of the
crystalreportviewers folder.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>web_application_name</display-name>
<context-param>
<param-name>crystal_image_uri</param-name>
<param-value>/web_application_name/crystalreportviewers</param-value>
</context-param>
<context-param>
<param-name>crystal_servlet_uri</param-name>
<param-value>/CrystalReportViewerHandler</param-value>
</context-param>
<servlet>
<servlet-name>CrystalReportViewerServlet</servlet-name>
<servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CrystalReportViewerServlet</servlet-name>
<url-pattern>/CrystalReportViewerHandler</url-pattern>
</servlet-mapping>
</web-app>Example: Web.xml file using JSF
You must change the following parameters:
display-name - Name of your web
application.
crystal_image_uri parameter value -
Location of the
crystalreportviewers folder.
<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>web_application_name</display-name>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.application.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<context-param>
<param-name>crystal_image_uri</param-name>
<param-value>/web_application_name/crystalreportviewers</param-value>
</context-param>
<context-param>
<param-name>crystal_servlet_uri</param-name>
<param-value>/crystalreportviewerservlet</param-value>
</context-param>
<servlet>
<servlet-name>CrystalReportViewerServlet</servlet-name>
<servlet-class>com.crystaldecisions.report.web.viewer.CrystalReportViewerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CrystalReportViewerServlet</servlet-name>
<url-pattern>/CrystalReportViewerHandler</url-pattern>
</servlet-mapping>
</web-app>