2 Replies Latest reply on Oct 25, 2007 6:33 AM by mars1412

    Seam Text: linebreaks in .properties file

    mars1412 Apprentice

      How do I write Seam-Text that includes linebreaks into a .properties file?

      e.g. the seam-text source code is:

      The other guy said:
      
      "Nyeah nyeah-nee
      /nyeah/ nyeah!"
      

      will render as:
      <p>
      The other guy said:
      </p>
      <q>Nyeah nyeah-nee
      <i>nyeah</i> nyeah!</q>
      


      the question is: how can I put the source text into a .properties file?
      I just cannot figure out how to include linebreaks...
      I can use a \ at the end of a line to continue in the next line, but this will not result in a line-break

      thanx in advance

        • 1. Re: Seam Text: linebreaks in .properties file
          Elias Ross Master

          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 Apprentice

            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 generated

            The 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 entry
            The 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.