• 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: WOResponse & appendContentString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WOResponse & appendContentString


  • Subject: Re: WOResponse & appendContentString
  • From: Lachlan Deck <email@hidden>
  • Date: Thu, 18 Oct 2007 11:38:30 +1000

On 18/10/2007, at 10:41 AM, Jonathan Miller wrote:

I'm using a custom Request Handler that returns a JavaScript which redirects the browser to a new page. In development mode this works fine but when deployed instead of returning the javascript the browser just prints it as text. Does anyone know what I'm doing wrong?

CODE

if("Production".equals(System.getProperty("MODE"))) {
sb.append("<html><body><script type=\"text/javascript\">\n \t")
.append("url = '").append(System.getProperty ("HTTP_SERVER")).append("/VideoLuna/WebObjects/VideoLuna.woa/wa/ videoManager?wosid=").append(wosid)
.append("';\n\t").append("window.location.replace(url); \n</script></body></html>");
response.appendContentString(sb.toString());

}

WOResponse result; // assume exists result.setHeader( "text/javascript", "content-type" ); return result;

with regards,
--

Lachlan Deck



_______________________________________________
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: 
 >re: WOResponse & appendContentString (From: Jonathan Miller <email@hidden>)

  • Prev by Date: re: WOResponse & appendContentString
  • Next by Date: Fwd: WOResponse & appendContentString
  • Previous by thread: re: WOResponse & appendContentString
  • Next by thread: Fwd: WOResponse & appendContentString
  • Index(es):
    • Date
    • Thread