This content has been marked as final.
Show 2 replies
-
1. Re: Seam Text: linebreaks in .properties file
genman Oct 24, 2007 5:36 PM (in response to mars1412)Read the JavaDoc for java.util.Properties:
Then every entry in this Properties table is written out, one per line. For each entry the key string is written, then an ASCII =, then the associated element string. Each character of the key and element strings is examined to see whether it should be rendered as an escape sequence. The ASCII characters \, tab, form feed, newline, and carriage return are written as \\, \t, \f \n, and \r, respectively. Characters less than \u0020 and characters greater than \u007E are written as \uxxxx for the appropriate hexadecimal value xxxx. For the key, all space characters are written with a preceding \ character. For the element, leading space characters, but not embedded or trailing space characters, are written with a preceding \ character. The key and element characters #, !, =, and : are written with a preceding backslash to ensure that they are properly loaded.
So use \r\n -
2. Re: Seam Text: linebreaks in .properties file
mars1412 Oct 25, 2007 6:33 AM (in response to mars1412)thanks a lot
in fact I have read the docs and also tried it (\n, \r,..).
for every one who is interested in the details: http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html#load(java.io.InputStream)
but my mistake was, that I had forgotten to include the blank lines (\n\ in the .properties file)
for the sake of completeness, here is the example:
WRONG .properties fiel entry - no paragraph will be generatedThe other guy said:\n\ "Nyeah nyeah-nee\ /nyeah/ nyeah!"
will render as:<p> The other guy said: </p>
(rest is missing, don't know why...)
CORRECT .properties fiel entryThe other guy said:\n\ \n\ "Nyeah nyeah-nee\ /nyeah/ nyeah!"
will render as<p> The other guy said: </p> <blockquote> Nyeah nyeah-nee<i>nyeah</i> nyeah!</blockquote>
the only difference is the empty line (\n\) in the correct example.