InfoCenter Home >
4: Developing applications >
4.2: Building Web applications >
4.2.1: Developing servlets >
4.2.1.3: Servlet content, examples, and samples >
4.2.1.3.9: PageListServlet support >
4.2.1.3.9.5: PageListServlet client type configuration file

4.2.1.3.9.5: PageListServlet client type configuration file

In addition to providing the page list mapping capability, the PageListServlet also has Client Type Detection support. Using the configuration information in the client_types.xml file, a servlet can determine the markup-language type the calling client requires for the response.

This support allows the servlet, extending PageListServet, to call an appropriate JSP file, with the callPage() method, based on the markup-language type of the request. The client type detection method, getMLTypeFromRequest(HttpServletRequest request), provided by the PageListServlet, inspects the HttpServletRequest object's request headers, and searches for a match in the client_types.xml file.

The client type detection method does the following:

  1. Using the input HttpServletRequest and the client_types.xml file, it checks for a matching HTTP request name and value. If found, it returns the markup-language value configured for the <client-type> element.
  2. If multiple matches are found, it returns the markup-language for the first <client-type> (for which a match was found).
  3. If no match was found, it returns the value of the markup-language for the default page defined in the PageListServlet configuration.

The client_types.xml file is located in the product_installation_root/properties directory.

Go to previous article: Example of the XML servlet configuration file Go to next article: Example of a client type configuration file

 

 
Go to previous article: Example of the XML servlet configuration file Go to next article: Example of a client type configuration file