Setting encoding and other output properties

In XUI-framework, there are several ways to set encoding and other output properties. To apply output properties throughout the application, the output properties should be set in 'xui-config.properties' file. The output properties that are specific to the page should be set using <xui:view> tag attributes. The 'omit-xml-declaration' and 'method' properties are reserved by XUI and cannot be overwritten.

1. Setting output properties using properties file

In the 'xui-config.properties' file located under '\WEB-INF\classes\' folder, the parameters can be set to apply to the entire application. The available parameters for output properties are:

  • cdata-section-elements
  • doctype-public
  • doctype-system
  • encoding
  • indent
  • media-typed
  • standalone
  • version

The 'omit-xml-declaration' and 'method' properties are reserved by XUI and they cannot be overwritten through the parameters in properties file. Please note that any white space is not ignored in the properties file.

2. Setting output properties using <xui:view> tag

The output properties can be set as the attributes of <xui:view> tag. The available attributes for output properties are:

  • cdata-section-elements
  • doctype-public
  • doctype-system
  • encoding
  • indent
  • media-typed
  • standalone
  • version

The 'omit-xml-declaration' and 'method' properties are reserved by XUI and they cannot be overwritten by the attributes of <xui:view> tag. When the output properties are set in the <xui:view> tags, they will overwrite the values set by the parameters in the 'xui-config.properties'.

3. Setting encoding in the JSP directive

When the ‘contentType’ is set in the JSP page directive and ’charset’ is specified, XUI reads the information from the ‘contentType’ value and uses for encoding setting. For example, when the following code appear on the top of the XUI page, the encoding ‘shift_jis’ is set for the output properties, as well as used in the Content-Type response header.

<%@ page contentType="text/html; charset=shift_jis" %>

When the encoding is set in JSP page directive, it will overwrite the encoding set in the properties file. However if the encoding is set in the <xui:view> tag, the value of ‘encoding’ attribute of <xui:view> tag will be used for output encoding.


Back to: Application Guide

 

 


COPYRIGHT © 1997–2006 JWAY GROUP, Inc.
All Rights Reserved. XUI is a registered trademark of JWAY GROUP, Inc.

All other designated trademarks and brands are properties of their respective owners.