<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi everybody!<br>
<br>
I'm working on a project using Seaside for the first time, and for
various reasons it needs to output Content-Type: "text/plain"
documents.&nbsp;&nbsp; So having no idea, how Seaside's internals work I started
sticking in random 'self break' statements, until I found a place that
the Content-Type was set.&nbsp; What I did so far was:<br>
<br>
WAHtmlRoot&lt;&lt;contentType<br>
&nbsp;&nbsp;&nbsp; ^ mimeType ifNil: ['text/html'] ifNotNil: [mimeType]<br>
<br>
<br>
WAHtmlRoot&lt;&lt;mimeType<br>
&nbsp;&nbsp; &nbsp;^ mimeType<br>
<br>
WAHtmlRoot&lt;&lt;mimeType: aString <br>
&nbsp;&nbsp;&nbsp; ^ mimeType := aString<br>
<br>
This at least allows me to change what was previously a hardcoded
content type, but it wasn't enough to allow access from the viewer as I
couldn't find an obvious way to access the response object through the
html one so:<br>
<br>
WAHtmlDocument&lt;&lt;response<br>
&nbsp;&nbsp;&nbsp; ^response<br>
<br>
WAHtmlDocument&lt;&lt;response: aResponse<br>
&nbsp;&nbsp;&nbsp; ^response := aResponse<br>
<br>
WARender&lt;&lt;buildResponse<br>
&nbsp;&nbsp;&nbsp; | response document |<br>
&nbsp;&nbsp;&nbsp; self updateUrl: url.<br>
&nbsp;&nbsp;&nbsp; context actionUrl: url. <br>
&nbsp;&nbsp;&nbsp; response := self newResponse.<br>
&nbsp;&nbsp;&nbsp; response headerAt: 'Cache-Control' put: 'No-cache'.<br>
&nbsp;&nbsp;&nbsp; document := self session outputDocumentClass root: self
buildDocRoot.<br>
&nbsp;&nbsp;&nbsp; document stream: response stream.<br>
<b>&nbsp;&nbsp;&nbsp; document response: response.</b><br>
&nbsp;&nbsp;&nbsp; context document: document.<br>
&nbsp;&nbsp;&nbsp; root decorationChainDo: [:ea | ea renderWithContext: context].&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; self writeOnLoadOn: document.<br>
&nbsp;&nbsp;&nbsp; document close.<br>
&nbsp;&nbsp;&nbsp; ^ response<br>
<br>
At this point I could now alter the response within my View class:<br>
<br>
TestView&lt;&lt;renderContentOn: html<br>
&nbsp;&nbsp;&nbsp; html context document response contentType: 'text/plain'.<br>
&nbsp;&nbsp;&nbsp; html text: 'Testing 1 2 3'<br>
<br>
Generates a page of type 'text/plain' but the page is just the
javascript load preamble:<br>
<br>
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"<br>
<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</a>&gt;&lt;html
lang="en" xml:lang="en"
xmlns=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/1999/xhtml">"http://www.w3.org/1999/xhtml"</a>&gt;&lt;head&gt;&lt;title&gt;Seaside&lt;/title&gt;&lt;meta
content="text/html; charset=utf-8" http-equiv="Content-Type"
/&gt;&lt;link type="text/css"
href="/seaside/files/WAStandardFiles/basics.css" rel="stylesheet"
/&gt;&lt;link type="text/css"
href="/seaside/files/WAStandardFiles/kalseyTabs.css" rel="stylesheet"
/&gt;&lt;link type="text/css"
href="/seaside/files/WAStandardFiles/sourceStyle.css" rel="stylesheet"
/&gt;&lt;script type="text/javascript"
src="/seaside/files/WAStandardFiles/externalAnchors.js"&gt;&lt;/script&gt;&lt;script
type="text/javascript"
src="/seaside/files/WAStandardFiles/misc.js"&gt;&lt;/script&gt;&lt;script
type="text/javascript"
src="/seaside/files/WAStandardFiles/shortcuts.js"&gt;&lt;/script&gt;&lt;link
type="text/css" href="/seaside/Test?_s=UbxOBKHRLUulbtSV"
rel="stylesheet" /&gt;&lt;/head&gt;&lt;body
onkeydown="onKeyDown(event)" onload="onLoad()"&gt;&lt;div
id="frameContent"&gt;testing 1 2
3&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div
id="toolbar"&gt;&lt;a
href="?_k=zekhIJre&amp;amp;_s=VkiqJeuwtxwWVIAM&amp;amp;1"&gt;New
Session&lt;/a&gt;&amp;nbsp;&lt;a
href="?_k=zekhIJre&amp;amp;_s=VkiqJeuwtxwWVIAM&amp;amp;2"&gt;Configure&lt;/a&gt;&amp;nbsp;&lt;a
href="?_k=zekhIJre&amp;amp;_s=VkiqJeuwtxwWVIAM&amp;amp;3"&gt;Toggle
Halos&lt;/a&gt;&amp;nbsp;&lt;a
href="?_k=zekhIJre&amp;amp;_s=VkiqJeuwtxwWVIAM&amp;amp;4"&gt;Spot
Profiler&lt;/a&gt;&amp;nbsp;&lt;a
href="?_k=zekhIJre&amp;amp;_s=VkiqJeuwtxwWVIAM&amp;amp;5"&gt;Memory&lt;/a&gt;&amp;nbsp;&lt;a
href="?_k=zekhIJre&amp;amp;_s=VkiqJeuwtxwWVIAM&amp;amp;6"&gt;Profiler&lt;/a&gt;&amp;nbsp;&lt;a
href=<a class="moz-txt-link-rfc2396E" href="http://localhost:3900/seaside/Test?terminate=1&amp;_s=VkiqJeuwtxwWVIAM&amp;_k=zekhIJre">"http://localhost:3900/seaside/Test?terminate=1&amp;amp;_s=VkiqJeuwtxwWVIAM&amp;amp;_k=zekhIJre"</a>&gt;Terminate&lt;/a&gt;&amp;nbsp;&lt;a
title="Validate XHTML"
href=<a class="moz-txt-link-rfc2396E" href="http://validator.w3.org/check/referer">"http://validator.w3.org/check/referer"</a>&gt;XHTML&lt;/a&gt;&amp;nbsp;&lt;span
title="Render Time"&gt;0&lt;/span&gt;/&lt;span title="Callback
Time"&gt;0&lt;/span&gt; ms&lt;/div&gt;&lt;script
type="text/javascript"&gt;/*&lt;![CDATA[*/function
onLoad(){}/*]]&gt;*/&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;<br>
<br>
So my question is how do I override this!<br>
<br>
I noticed that I can override the response stream in my View object,
but there's a continuation which gets called which will overwrite
whatever I put in the stream.&nbsp; Am I going about this totally the wrong
way?<br>
<br>
Dave<br>
</body>
</html>