You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Harod Ruthgar <ha...@yahoo.com.au> on 2003/12/08 06:47:32 UTC

linefeeds in a resource properties file

Hello,

How to add linefeeds to a property file within struts?

This thread
(http://forum.java.sun.com/thread.jsp?forum=31&thread=400653)
says that we can add \n to a String.

However, if I put \n to a resource property line
e.g.
my.key = my value 1 \n my value 2

and then I use <html:textarea> tag to display the
value
e.g.
<c:set var="emailBodyValue">
  <bean:message bundle="ParticipantMsgKey"
key="participant.create.step3.defaultEmailBody"/>
</c:set>						<html-el:textarea
property="parameterBuffer.emailBody" cols="60"
rows="10" value="${emailBodyValue}"/>

It will display "\n" instead of line feed.

I notice that html:textarea converts a single
quotation mark ' into &#39;
Now, the codes for line feed or new line are &#10; and
&#13;, but if I put &#10; into the properties file, it
will be converted into &amp;#10;.

I have tried this by
- having &#10; in the properties file
- passing &#10; as an argument to <bean:message>
Both still convert &#10; into &amp;#10;

I have also tried using empty line with backslash
character in the properties file
e.g.
my.key = my value 1\
         \
         my value 2
It doesn't work as well.


Any solution to this?


Regards,
Harod Ruthgar

http://personals.yahoo.com.au - Yahoo! Personals
New people, new possibilities. FREE for a limited time.

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org