Dashboard > WebWork > ... > FAQ > How to escape special chars in resource bundles
  WebWork Log In View a printable version of the current page.  
  How to escape special chars in resource bundles
Added by Rainer Hermanns, last edited by tm_jee on Feb 21, 2007  (view change) show comment
Labels: 
(None)

Normal Java resource bundles

In this case the important aspect is the following:
API: java.util.Properties

The method does not treat a backslash character, \, before a non-valid escape character as an error; the backslash is silently dropped. For example, in a Java string the sequence "\z" would cause a compile time error. In contrast, this method silently drops the backslash. Therefore, this method treats the two character sequence "\b" as equivalent to the single character 'b'.

MessageFormat rules

Extensively describing rules for embedding " and {. (see javadoc API for MessageFormat)

The special chars ', } and {:

  • escape ' with another ' : resulting in '' (double-single quote)
  • escape \ with another \: resulting in \ \ (double backslash)
  • enclose } with ': resulting in '}'
  • enclose { with ': resulting in '{'

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators