• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: toHTMLString [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >toHTMLString (From: Dev WO <email@hidden>)
 >Re: toHTMLString (From: Dev WO <email@hidden>)
 >Re: toHTMLString (From: Mike Schrag <email@hidden>)
 >Re: toHTMLString (From: Dev WO <email@hidden>)
 >Re: toHTMLString (From: Mike Schrag <email@hidden>)

  • Prev by Date: Workaround: Xcode1.5 won't let me add existing files to project
  • Next by Date: Re: www.apple.com/webobjects updated for 5.3
  • Previous by thread: Re: toHTMLString
  • Next by thread: Automated data exchange between mySQL and MS SQL
  • Index(es):
    • Date
    • Thread