You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Thiago H de Paula Figueiredo <th...@gmail.com> on 2013/09/28 05:34:34 UTC

[T5.4-a-22] Core stack being added to page non-HTML MarkupWriter-generated output

Hi!

I'm writing a page to generate an RSS 2.0 document though MarkupWriter[1].  
Tapestry is then trying to add JavaScript to it anyway: "The root element  
of the rendered document was <rss>, not <html>. A root element of <html>  
is needed when linking JavaScript and stylesheet resources."

Is this a bug? I think so, even being something of a corner case.  
Shouldn't Tapestry refrain from adding the core stack (or any CSS or  
JavaScript) for pages with content type different than text/html or  
application/xhtml+xml (XHTML)?

[1] I do that to avoid needing to use some XML DOM implementation and then  
serialize it as a String to return a StreamResponse. Also to avoid an  
external dependency to an RSS package like Rome.

-- 
Thiago H. de Paula Figueiredo

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


Re: [T5.4-a-22] Core stack being added to page non-HTML MarkupWriter-generated output

Posted by Lance Java <la...@googlemail.com>.
Hi Denis, my workaround was meant for Thiago since he's not using a
template.

You might find it difficult (near impossible) to invoke tapestry's template
rendering yourself. I think you'll need to patch the issue, this will
likely require tweaking the "JavaScriptSupport" MarkupRendererFilter that
is contributed to the MarkupRenderer (in TapestryModule).

Re: [T5.4-a-22] Core stack being added to page non-HTML MarkupWriter-generated output

Posted by Denis Delangle <de...@gmail.com>.
Hello,

Thank's a lot for your answers, I filled this issue with a patch
https://issues.apache.org/jira/browse/TAP5-2200
The problem is that the core stack is included whatever the content type is.

Using @ContentType("application/rss+xml") didn't work for me.
The StreamResponse should be OK, I will try it.

Denis

2013/10/10 Lance Java <la...@googlemail.com>:
> A workaround is to get a MarkupWriter instance from MarkupWriterFactory and
> return a StreamResponse.

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


Re: [T5.4-a-22] Core stack being added to page non-HTML MarkupWriter-generated output

Posted by Lance Java <la...@googlemail.com>.
A workaround is to get a MarkupWriter instance from MarkupWriterFactory and
return a StreamResponse.

Re: [T5.4-a-22] Core stack being added to page non-HTML MarkupWriter-generated output

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 10 Oct 2013 11:29:57 -0300, Denis Delangle  
<de...@gmail.com> wrote:

> Hello,

Hi!

>
> I also have this issue with 5.4 alpha 22. It is a regression I guess
> as it was OK with alpha-11. I define a page like this :
>
> @ContentType("text/xml")
> public class ModuleInfo {

@ContentType("application/rss+xml") was the solution.

> and have a template like
>
> <info xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>    <moduleName>${context.moduleName}</moduleName>

My page doesn't have a template: everything is generated through  
MarkupWriter.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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


Re: [T5.4-a-22] Core stack being added to page non-HTML MarkupWriter-generated output

Posted by Denis Delangle <de...@gmail.com>.
Hello,

I also have this issue with 5.4 alpha 22. It is a regression I guess
as it was OK with alpha-11. I define a page like this :

@ContentType("text/xml")
public class ModuleInfo {
...

and have a template like

<info xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
   <moduleName>${context.moduleName}</moduleName>
...

And I get the same error message "The root element of the rendered
document was <info>, not <html>. A root element of <html> is needed
when linking JavaScript and stylesheet resources."

Did you find a way to make your RSS module run with the alpha-22 ?

Thanks a lot,

Denis



2013/9/28 Thiago H de Paula Figueiredo <th...@gmail.com>:
> Hi!
>
> I'm writing a page to generate an RSS 2.0 document though MarkupWriter[1].
> Tapestry is then trying to add JavaScript to it anyway: "The root element of
> the rendered document was <rss>, not <html>. A root element of <html> is
> needed when linking JavaScript and stylesheet resources."
>
> Is this a bug? I think so, even being something of a corner case. Shouldn't
> Tapestry refrain from adding the core stack (or any CSS or JavaScript) for
> pages with content type different than text/html or application/xhtml+xml
> (XHTML)?
>
> [1] I do that to avoid needing to use some XML DOM implementation and then
> serialize it as a String to return a StreamResponse. Also to avoid an
> external dependency to an RSS package like Rome.
>
> --
> Thiago H. de Paula Figueiredo
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>

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