Configuration properties

This table lists all the configurable properties for the library. The default properties are defined in the JTidyServlet.properties file included in the library jar.

There are 2 ways to override default property settings for the whole web application:

  • Create a custom properties file named "JTidyServlet.properties" and place it in the application classpath. If the key required does not exist in the specified file, the key will take default value defined in the code.
  • Create a custom properties file with name other than "JTidyServlet.properties" and place it in the application classpath. Define <init-param> properties.filename for JTidyFilter or JTidyServlet in web.xml . If the key required does not exist in the specified file, the key will take default value defined in the file "JTidyServlet.properties".

Configure properties using JTidyServlet in your application web.xml

                
<web-app>
...
  <servlet>
    <servlet-name>JTidyServlet</servlet-name>
    <servlet-class>org.w3c.tidy.servlet.TidyServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    <init-param>
        <param-name>properties.filename</param-name>
        <param-value>JTidyServletProduction.properties</param-value>
    </init-param>
  </servlet>
                
            

Configure properties using JTidyFilter in your application web.xml

                
<web-app>
...
  <filter>
    <filter-name>JTidyFilter</filter-name>
    <filter-class>org.w3c.tidy.servlet.filter.JTidyFilter</filter-class>
    <init-param>
        <param-name>properties.filename</param-name>
        <param-value>JTidyServletProduction.properties</param-value>
    </init-param>
  </filter>
                
            

JTidyServlet.properties

PropertyDefaultValid ValuesDescription
imageGetTimeout2000Any reasonable number Time in milliseconds the servlet thread will sleep if Record is not yet available in Repository. If validate only is on, browser receives and start displaying HTML page before it was validated by JTidy.
imageNamePrefixjtidy_html_32x26_String The image name prefix for validation icons. You could change images to better match your application style. First servlet will try to load image from Resources using ClassLoader if not found would be redirected to RequestDispatcher.
imageNameExtension.pngString Image name is constructed from imageNamePrefix + [unknown|error|warning|ok] + imageNameExtension
imageWidth32int
imageHeight26int
xhtmltruebooleanoutput jtidy validation image tag as xhtml
JTidyServletURI/JTidyString Real path to JTidyServlet should match one in web.xml <servlet-mapping><url-pattern> for JTidyServlet. This value is used to build working links to validation images and JTidy reports created by <jtidy:validationImage/> JSP Tags. The href and src would begin with this string request.getContextPath() + JTidyServletURI
repositoryFactory.class ...DefaultRepositoryFactory Fully Qualified Class name for a valid RepositoryFactory implementation Public interface for user to redefine validation results handling.