Board index » jbuilder » How to display Java format string 'as is' in web page?

How to display Java format string 'as is' in web page?


2005-07-12 02:38:57 PM
jbuilder18
In one part of my Struts web app I want to display and then edit a Java format string, like...
This is a Java\tformat string\nthat will be used by {0} to {1}
In my web app page I want to see all the '\' format text entries, but when I display this type of string in a Struts text area control the display process translates the '\' chars and does not display them.
Is there a way to get around this and display the string in its original state?
 
 

Re:How to display Java format string 'as is' in web page?

davout wrote:
Quote
In one part of my Struts web app I want to display and then edit a
Java format string, like...

This is a Java\tformat string\nthat will be used by {0} to {1}

In my web app page I want to see all the '\' format text entries, but
when I display this type of string in a Struts text area control the
display process translates the '\' chars and does not display them.

Is there a way to get around this and display the string in its
original state?
At a guess, you would have to control the retrieval and storage of the
strings yourself. When you retrieve the string, replace '\' with '\\'
so that the backslash displays correctly. To store the string, replace
'\\' with '\'.
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
www.datadevelopment.com/
NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
www.datadevelopment.com/papers/index.html
Please see Borland's newsgroup guidelines at
info.borland.com/newsgroups/guide.html