You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Dimo Velev <ve...@in.tum.de> on 2005/03/17 23:41:42 UTC

myfaces + tiles: jsf produced content and pure html getting rearranged

Hi,

Has anyone noticed some strange rearrangement of jsf and html when using
tiles? All the non jsf produced output seems to gather at the end of the
included page, which is totally unacceptable. Consider the following jsf
code, which includes another jsf page:
---cut---
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles"%>
<f:view>
	<f:subview id="banner">
		<tiles:insert attribute="bla" flush="false"/>
	</f:subview>
</f:view>
---cut---
and contents of the included file looks like this:
---cut---
<h1>header1</h1>
<f:verbatim>jsf in the middle</f:verbatim>
<h2>header2</h2>
---cut---
would produce the following output (where the first two lines should be in
the reverse order):
---cut---
jsf in the middle 
<h1>header1</h1>
<h2>header2</h2>
---cut---

It seems to work alright if I substitute all the pure html tags [html tag]
for <f:verbatim>[html tag]</f:verbatim>

Thanks in advance,
Dimo

PS. I did not copy/paste the sources above, but wrote them by memory. If it
helps I could post some working example files.


Re: myfaces + tiles: jsf produced content and pure html getting rearranged

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
Dimo,

see [1] to read more on issues like that:


<f:verbatim> *wrappes* a <h:outputText/> around
your HTML or what ever.

Also you could use <h:outputText value="xxxxx" escape="false"/>

Yes... that may blow up your pages, but it will be addressed
in JSF 1.2 Spec.

-MAtthias

[1] http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html




Dimo Velev wrote:
> Hi,
> 
> Has anyone noticed some strange rearrangement of jsf and html when using
> tiles? All the non jsf produced output seems to gather at the end of the
> included page, which is totally unacceptable. Consider the following jsf
> code, which includes another jsf page:
> ---cut---
> <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
> <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
> <%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles"%>
> <f:view>
> 	<f:subview id="banner">
> 		<tiles:insert attribute="bla" flush="false"/>
> 	</f:subview>
> </f:view>
> ---cut---
> and contents of the included file looks like this:
> ---cut---
> <h1>header1</h1>
> <f:verbatim>jsf in the middle</f:verbatim>
> <h2>header2</h2>
> ---cut---
> would produce the following output (where the first two lines should be in
> the reverse order):
> ---cut---
> jsf in the middle 
> <h1>header1</h1>
> <h2>header2</h2>
> ---cut---
> 
> It seems to work alright if I substitute all the pure html tags [html tag]
> for <f:verbatim>[html tag]</f:verbatim>
> 
> Thanks in advance,
> Dimo
> 
> PS. I did not copy/paste the sources above, but wrote them by memory. If it
> helps I could post some working example files.
> 
> 

-- 
Matthias Weßendorf
Aechterhoek 18
DE-48282 Emsdetten
Germany
phone: +49-2572-9170275
cell phone: +49-179-1118979
email: matzew AT apache DOT org
url: http://www.wessendorf.net
callto://mwessendorf (Skype)
icq: 47016183

Re: myfaces + tiles: jsf produced content and pure html getting rearranged

Posted by Sean Schofield <se...@gmail.com>.
Unfortunately you need to use <f:verbatim> on everything in your
subview.  There are some rather complex reasons for that but
unfortunately there is no way around it.

sean


On Thu, 17 Mar 2005 23:41:42 +0100, Dimo Velev <ve...@in.tum.de> wrote:
> Hi,
> 
> Has anyone noticed some strange rearrangement of jsf and html when using
> tiles? All the non jsf produced output seems to gather at the end of the
> included page, which is totally unacceptable. Consider the following jsf
> code, which includes another jsf page:
> ---cut---
> <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
> <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
> <%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles"%>
> <f:view>
>         <f:subview id="banner">
>                 <tiles:insert attribute="bla" flush="false"/>
>         </f:subview>
> </f:view>
> ---cut---
> and contents of the included file looks like this:
> ---cut---
> <h1>header1</h1>
> <f:verbatim>jsf in the middle</f:verbatim>
> <h2>header2</h2>
> ---cut---
> would produce the following output (where the first two lines should be in
> the reverse order):
> ---cut---
> jsf in the middle
> <h1>header1</h1>
> <h2>header2</h2>
> ---cut---
> 
> It seems to work alright if I substitute all the pure html tags [html tag]
> for <f:verbatim>[html tag]</f:verbatim>
> 
> Thanks in advance,
> Dimo
> 
> PS. I did not copy/paste the sources above, but wrote them by memory. If it
> helps I could post some working example files.
> 
>