Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Moved the redundant and out-of-place "Output Content Type and Charset" section to the existing "Content Type and Markup" page

...

Note that the locale for a page is fixed (it can't change once the page instance is created). In addition, a page may only be attached to a request once. In other words, if code in your page changes the persistent locale, you won't see a change to the page's locale (or localized messages) in that request.

Output Content Type and Charset

When Tapestry renders a page, the very first step is to determine the output content type and charset.

This information is obtained from meta data on the page itself. Meta data is specified using the @Meta annotation.

The response content type is obtained via meta-data key tapestry.response-content-type. This value defaults to "text/html".

As a convenience, the @ContentType annotation can be used to specify the response content type. The value attribute of the annotation is the content type.

The character set for all outgoing markup and all incoming requests is "UTF-8". UTF-8 is a version of Unicode where individual characters are encoded as one or more bytes. Most western language characters (that is, typical ASCII characters) are encoded in a single byte. Accented characters or non-western characters (such as Japanese, Arabic, etc.) may be encoded as two or more bytes.