Configuring a servletAdded by IBM on July 25, 2013 | Version 1 (Original)
|In the web.xml file for your application, you must specify the URI of the Webform Server translator servlet. You also have the option of specifying limits on the type and size of files that users can attach to forms.
Note: If you are making changes to a web.xml file that is already deployed under WebSphere® Application Server, use the Application Assembly Tool to make those changes. WebSphere Application Server does not automatically recognize changes made to the web.xml file with a text editor.
Table 1. The table contains init-param settings and their descriptions.
|translatorLocation||Yes||The location of the Translator servlet (called translator). For example: |
Note: If you are setting up a clustered environment, you may need to set this to point to your clustering mechanism.
|disableResourceCache||No||Framework Caching transfers the caching of resources from the Translator to the Framework level.|
true — Framework caching is disabled.
false — Framework caching is enabled
|attachmentMaxSize_kb||No||The maximum size in kilobytes of any one attachment in a form. The file size of each attachment must be less than or equal to this value.|
Default: -1 (all file types are allowed)
|attachmentMaxTotalSize_kb||No||The maximum size in kilobytes of all attachments in a form. The sum of the file sizes of all attachments must be less than or equal to this value.|
Default: -1 (all file types are allowed)
|attachmentAllowedTypes||No||A space-delimited list of file types that can be attached to a form. The list can be MIME types, file name extensions, or a combination. You can use * as a wildcard in the MIME subtype. For example:|
text/* application/pdf .png .gif .jpg .jpeg
The file extensions must begin with the . character, and are not case sensitive. That is, .jpg includes .JPG and all other combinations of case.
Because Internet browsers are not consistent in the MIME types that they produce for files of various types, you should test each browser that you plan to support to make sure that it produces the MIME type that you expect.
Default: all file types are allowed
|attachmentUniqueNamesRequired||No||If set to true, all attachments in a form must have unique file names. File name comparisons are case sensitive.|
|outputType||No||Sets the type of HTML output. Must be one of: HTML4Transitional, HTML4Strict, or XHTML1Strict.|
|printOutputFormat||No||Determines what output format to generate. Valid settings are:|
If the setting is invalid or missing, the default behavior is determined by the printOutputFormat setting in the translator.properties file.
- png — Prints the form in full color. The margins will include the header and footer information that your browser is configured to include on output, such as URL, title of the webpage, and date/time accessed. Each page of the form is generated as one individual .png image file.
- gif — Prints the form in grayscale. The margins will include the header and footer information that your browser is configured to include on output, such as URL, title of the webpage, and date/time accessed. Each page of the form is generated as one individual .gif image file.
- pdf — Prints the form in full color. The form is generated as a single PDF file, regardless of the number of pages in the form. A PDF reader is required to view and print the form using this setting.
- pdfa — Prints the form in full color. The form is generated as a single PDF file, regardless of the number of pages in the form. This expanded PDF format is ideal for archival of the print output, since it saves and carries the dependencies of the form. For example, if you created a form using Comic Sans MS font, users who do not have Comic Sans MS installed on their computers would still be able to open your form and see the text in Comic Sans MS font. A PDF reader is required to view and print the form using this setting.
- plugin/png — Prints the form in PNG format, but excludes the header/footer information from your browser. This setting requires the use of the Webform Server plugin or ActiveX control.
- plugin/gif — Prints the form in GIF format, but excludes the header/footer information from your browser. This setting requires the use of the Webform Server plugin or ActiveX control.
In addition to setting attachment limits in the web.xml
file, attachment limits can also be set by the enclosuresettings option in the XFDL form, or by the translator in its translator.properties
file. Webform Server reads the settings from each location and then applies the most restrictive settings.
Parent topic: Creating a servlet
Configuring Translator Server
enclosuresettings WFS 801