Re: toHTMLString [SOLVED]
Re: toHTMLString [SOLVED]
- Subject: Re: toHTMLString [SOLVED]
- From: Dev WO <email@hidden>
- Date: Thu, 23 Jun 2005 23:18:21 +0200
Thanks Mike, this seems to work a lot better;)
stringByEscapingHTMLString is a static method on WOMessage, so you
need to:
import com.webobjects.appserver.WOMessage;
...
String unescapedString = "<Test>";
String escapedString = WOMessage.stringByEscapingString
(unescapedString);
...
On Jun 23, 2005, at 2:03 PM, Dev WO wrote:
Humm,
I cannot appendToResponse as the resulting string is used
somewhere else in the application and not sent back to the browser.
I need to use it in my framework (to extend an already existing
class) to make the new string available as if it was an attribute
of the parent class:
class Source
(has href(), title())
class SourceEX extends source
has string link which should be "<a href="href()ESCAPED"
title="title()">
I tried importing appserver:
import com.webobjects.appserver.*;
then either:
stringByEscapingHTMLString(href())
href().stringByEscapingHTMLString()
but always complaining about:
SourceEX.java:24: cannot resolve symbol
symbol : method stringByEscapingHTMLString (java.lang.String)
...
On WOMessage there is a static method String
stringByEscapingHTMLString(String) that is used by WO to escape
HTML. If you are just writing out to the response, you can use
woresponse.appendContentHTMLString(String) and it will call that
method and just write the response directly out.
ms
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden