You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Stephane Decleire <sd...@cariboo-networks.com> on 2006/05/04 14:44:33 UTC

getResponseWriter

Hi,

It seems that the function getResponseWriter of the BasePage class no 
more exists in T4 ...
Am i wrong ?
Is there an equivalent function ?

Thanks in advance.

-- 
Stéphane Decleire

05 56 57 99 20
06 63 78 69 06


Re: getResponseWriter

Posted by Bryan Lewis <br...@maine.rr.com>.
Would this help?

    @InjectObject("infrastructure:response")
    public abstract WebResponse getWebResponse();

    OutputStream os = getWebResponse().getOutputStream(contentType);


   
Stephane Decleire wrote:

> getResponseWriter was very usefull to get and store the result of a
> page generated by Tapestry instead of sending it to the user.
>
> ByteArrayOutputStream out = new ByteArrayOutputStream();
> IMarkupWriter writer = page.getResponseWriter(out);
> cycle.activate(page);
> cycle.renderPage(writer);
> writer.flush();
> String body = out.toString();
>
> None of those interfaces seems to be able to do the same thing ...
>
> Any idea is welcome
>
> Andreas Andreou wrote:
>
>> Yep, it was removed.
>> getResponseWriter returned a IMarkupWriter instance and it was used
>> by Tapestry 3 to render the page.
>> Tapestry 4 uses an IMarkupWriter according to the page's content type.
>> You can override the page's content type by overriding
>> BasePage.getResponseContentType()
>>
>> Also take a look at the MarkupFilter interface, its implementation
>> and the
>> tapestry.markup.MarkupFilters configuration point.
>>
>> On the other hand, if you want to create IMarkupWriter instances
>> you'll have to inject tapestry.markup.MarkupWriterSource and call
>> newMarkupWriter() on it.
>>
>> Stephane Decleire wrote:
>>
>>  
>>
>>> Hi,
>>>
>>> It seems that the function getResponseWriter of the BasePage class no
>>> more exists in T4 ...
>>> Am i wrong ?
>>> Is there an equivalent function ?
>>>
>>> Thanks in advance.
>>>
>>>   
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>  
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: getResponseWriter

Posted by Stephane Decleire <sd...@cariboo-networks.com>.
Thanks Andreas.
It works.

Andreas Andreou wrote:

>getMarkupWriterSource().newMarkupWriter(pw, new ContentType("text/html")) 
>will do just fine.
>
>Simply inject tapestry.markup.MarkupWriterSource in your page
>
>Stephane Decleire wrote:
>
>  
>
>>getResponseWriter was very usefull to get and store the result of a
>>page generated by Tapestry instead of sending it to the user.
>>
>>ByteArrayOutputStream out = new ByteArrayOutputStream();
>>IMarkupWriter writer = page.getResponseWriter(out);
>>cycle.activate(page);
>>cycle.renderPage(writer);
>>writer.flush();
>>String body = out.toString();
>>
>>None of those interfaces seems to be able to do the same thing ...
>>
>>Any idea is welcome
>>
>>Andreas Andreou wrote:
>>
>>    
>>
>>>Yep, it was removed.
>>>getResponseWriter returned a IMarkupWriter instance and it was used
>>>by Tapestry 3 to render the page.
>>>Tapestry 4 uses an IMarkupWriter according to the page's content type.
>>>You can override the page's content type by overriding
>>>BasePage.getResponseContentType()
>>>
>>>Also take a look at the MarkupFilter interface, its implementation
>>>and the
>>>tapestry.markup.MarkupFilters configuration point.
>>>
>>>On the other hand, if you want to create IMarkupWriter instances
>>>you'll have to inject tapestry.markup.MarkupWriterSource and call
>>>newMarkupWriter() on it.
>>>
>>>Stephane Decleire wrote:
>>>
>>> 
>>>
>>>      
>>>
>>>>Hi,
>>>>
>>>>It seems that the function getResponseWriter of the BasePage class no
>>>>more exists in T4 ...
>>>>Am i wrong ?
>>>>Is there an equivalent function ?
>>>>
>>>>Thanks in advance.
>>>>
>>>>  
>>>>        
>>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>> 
>>>
>>>      
>>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>

-- 
Stéphane Decleire

05 56 57 99 20
06 63 78 69 06


Re: getResponseWriter

Posted by Andreas Andreou <an...@di.uoa.gr>.
getMarkupWriterSource().newMarkupWriter(pw, new ContentType("text/html")) 
will do just fine.

Simply inject tapestry.markup.MarkupWriterSource in your page

Stephane Decleire wrote:

> getResponseWriter was very usefull to get and store the result of a
> page generated by Tapestry instead of sending it to the user.
>
> ByteArrayOutputStream out = new ByteArrayOutputStream();
> IMarkupWriter writer = page.getResponseWriter(out);
> cycle.activate(page);
> cycle.renderPage(writer);
> writer.flush();
> String body = out.toString();
>
> None of those interfaces seems to be able to do the same thing ...
>
> Any idea is welcome
>
> Andreas Andreou wrote:
>
>> Yep, it was removed.
>> getResponseWriter returned a IMarkupWriter instance and it was used
>> by Tapestry 3 to render the page.
>> Tapestry 4 uses an IMarkupWriter according to the page's content type.
>> You can override the page's content type by overriding
>> BasePage.getResponseContentType()
>>
>> Also take a look at the MarkupFilter interface, its implementation
>> and the
>> tapestry.markup.MarkupFilters configuration point.
>>
>> On the other hand, if you want to create IMarkupWriter instances
>> you'll have to inject tapestry.markup.MarkupWriterSource and call
>> newMarkupWriter() on it.
>>
>> Stephane Decleire wrote:
>>
>>  
>>
>>> Hi,
>>>
>>> It seems that the function getResponseWriter of the BasePage class no
>>> more exists in T4 ...
>>> Am i wrong ?
>>> Is there an equivalent function ?
>>>
>>> Thanks in advance.
>>>
>>>   
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>  
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: getResponseWriter

Posted by Stephane Decleire <sd...@cariboo-networks.com>.
getResponseWriter was very usefull to get and store the result of a page 
generated by Tapestry instead of sending it to the user.

ByteArrayOutputStream out = new ByteArrayOutputStream();
IMarkupWriter writer = page.getResponseWriter(out);
cycle.activate(page);
cycle.renderPage(writer);
writer.flush();
String body = out.toString();

None of those interfaces seems to be able to do the same thing ...

Any idea is welcome

Andreas Andreou wrote:

>Yep, it was removed.
>getResponseWriter returned a IMarkupWriter instance and it was used
>by Tapestry 3 to render the page.
>Tapestry 4 uses an IMarkupWriter according to the page's content type.
>You can override the page's content type by overriding
>BasePage.getResponseContentType()
>
>Also take a look at the MarkupFilter interface, its implementation and the
>tapestry.markup.MarkupFilters configuration point.
>
>On the other hand, if you want to create IMarkupWriter instances
>you'll have to inject tapestry.markup.MarkupWriterSource and call
>newMarkupWriter() on it.
>
>Stephane Decleire wrote:
>
>  
>
>>Hi,
>>
>>It seems that the function getResponseWriter of the BasePage class no
>>more exists in T4 ...
>>Am i wrong ?
>>Is there an equivalent function ?
>>
>>Thanks in advance.
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>

-- 
Stéphane Decleire

05 56 57 99 20
06 63 78 69 06


Re: getResponseWriter

Posted by Andreas Andreou <an...@di.uoa.gr>.
Yep, it was removed.
getResponseWriter returned a IMarkupWriter instance and it was used
by Tapestry 3 to render the page.
Tapestry 4 uses an IMarkupWriter according to the page's content type.
You can override the page's content type by overriding
BasePage.getResponseContentType()

Also take a look at the MarkupFilter interface, its implementation and the
tapestry.markup.MarkupFilters configuration point.

On the other hand, if you want to create IMarkupWriter instances
you'll have to inject tapestry.markup.MarkupWriterSource and call
newMarkupWriter() on it.

Stephane Decleire wrote:

> Hi,
>
> It seems that the function getResponseWriter of the BasePage class no
> more exists in T4 ...
> Am i wrong ?
> Is there an equivalent function ?
>
> Thanks in advance.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org