Reputation: 3728
I have this code in my gwt client side:
String out = result.getConsoleOutput().replaceAll("\n", "<br/>");
transOut.getElement().setInnerText(out);
Basically what comes out of consoleoutput() is text from a telnet client and transOut is a HTMLPanel in a UiBinder. I want it to show up pretty so I tried to change all the \n to html
, but when it shows up in firefox it looks like this on screen blah blah
blah blah...
. I am guessing gwt escapes the text somewhere how can I get it to write the real tag.
here is an image:
http://www.faciletek.com/errimage.png
Upvotes: 2
Views: 1064
Reputation: 5488
You need to:
String out = result.getConsoleOutput().replaceAll("\n", "<br/>");
transOut.getElement().setInnerHTML(out);
Note the setInnerHTML()
instead of setInnerText()
Upvotes: 4