FIX TextStreamResponse
public InputStream getStream() throws IOException {
ContentType ct = new ContentType(_contentType);
String charset = ct.getParameter("charset");
if (StringUtils.isNotBlank(charset)) {
return new ByteArrayInputStream(_text.getBytes(charse
Yes, forcing the encoding to "UTF-8" inside a ByteArrayInputStream did the
trick.
It works now!
I will soon make some tests to compare the two approaches (Template based
XML vs StreamResponse), since perfomance was the main reason I switched to
Tapestry. Will keep you posted.
Many thanks to all
> The problem is the that I can't make TextStreamResponse to show UTF-8 (greek
> in my case) characters.
> Dont know if it's related with this post:
>
>
http://www.nabble.com/T5-confused-about-Services-and-XmlHttpResponse-tf4160459.html#a11839004
Yes, my previous post pointed out a solution. Her
This is another way to do it. Look at the code for TextStreamResponse. Write
your own StreamResponse impl that's backed by a ByteArrayInputStream.
(The reason I avoid that approach is (a) you create an InputStream to write a
response, so under the covers Tap5 is reading from it and writing to
Essentially, you gave it a string (UTF16 in memory), and it is being
converted into bytes ( string.getBytes() within TextStreamResponse ).
And the contentType of the response is set also from TextStreamResponse.
I would double check what the string.getBytes() is returning, maybe it's
actually putt
I used
boolean beforeRenderTemplate(){
return false;
}
but couldn't skip rendering check
I will currently return xml using a template with the help of Fernando's
patch - TAPESTRY-1600.
This patch allows the generation of xml, from an xml-based description by
fixing the "cutting" of
You can override one of the page render methods (I think onactivate is one of
those, but check the Tap5 website) and return false to tell Tap to skip
the other steps of page rendering.
thanos <[EMAIL PROTECTED]> wrote:
thank you.
I tried that but I get a mix of xml and html erro String (i
thank you.
I tried that but I get a mix of xml and html erro String (insteαd of clean
xml document) as a response. Seems that it looks for a template (I dont have
one cause I didnt need it with textStreamResponse)
Inside onActivate I obtain a PrintWriter from the injected Response, using
"applic
If you're just returning an RSS feed you probably don't want any page wrapping,
etc. In that case you can:
@Inject
private Response _response;
You can then do things like setting headers and even write directly to the
container-provided OutputStream - bypassing the whole TextStreamResponse --