You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jesús Ramos <jr...@legosoft.com.mx> on 2003/08/17 20:39:37 UTC

ISSUE WHEN WRITING OUT XML WITH TAPESTRY

Good day, list!

I've found an issue when writing out XML documents with Tapestry.
I assumed that I had to implement a writer (obviuosly implementing IMarkupWriter) whose content type was "text/xml", then
write out the document elements using the @Any component. However, there seems to be
a problem in the writer, for it outputs nothing, until you remove the getWriter method you overrode to enable it.

Any idea why this happens?
Is this issue on the framework's side, or on my writer's side?

The following are the only methods and member variables not required by IMarkupWriter interface that I added to my writer:

private String _content = null;

public XWriter(OutputStream stream, String contentType) {
_content = contentType;
OutputStreamWriter owriter = new OutputStreamWriter(stream);
Writer bwriter = new BufferedWriter(owriter);
_writer = new PrintWriter(bwriter);
}

/**
*    returns a plain-text writer if no writer is specified in constructor.
*/
public String getContentType() {
return (_content == null ? "text/plain" : _content);
}

Best regards.

J. Ramos



RE: ISSUE WHEN WRITING OUT XML WITH TAPESTRY

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Creating an XMLWriter is virtually identical to the WMLWriter David Solis put in; please check your
code against it.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Jesús Ramos [mailto:jramos@legosoft.com.mx] 
> Sent: Sunday, August 17, 2003 2:40 PM
> To: Tapestry users
> Subject: ISSUE WHEN WRITING OUT XML WITH TAPESTRY
> 
> 
> Good day, list!
> 
> I've found an issue when writing out XML documents with 
> Tapestry. I assumed that I had to implement a writer 
> (obviuosly implementing IMarkupWriter) whose content type was 
> "text/xml", then write out the document elements using the 
> @Any component. However, there seems to be a problem in the 
> writer, for it outputs nothing, until you remove the 
> getWriter method you overrode to enable it.
> 
> Any idea why this happens?
> Is this issue on the framework's side, or on my writer's side?
> 
> The following are the only methods and member variables not 
> required by IMarkupWriter interface that I added to my writer:
> 
> private String _content = null;
> 
> public XWriter(OutputStream stream, String contentType) { 
> _content = contentType; OutputStreamWriter owriter = new 
> OutputStreamWriter(stream); Writer bwriter = new 
> BufferedWriter(owriter); _writer = new PrintWriter(bwriter); }
> 
> /**
> *    returns a plain-text writer if no writer is specified in 
> constructor.
> */
> public String getContentType() {
> return (_content == null ? "text/plain" : _content);
> }
> 
> Best regards.
> 
> J. Ramos
> 
> 
>