2007/11/2, Holger Igel <[EMAIL PROTECTED]>:
>
> I have a (simple) question:
>
> I want to use a definition with an inline content. This content contains
jsf
> tags.
> ...
>         <tiles:putAttribute name="body">
>
>         <h:outputText value="hOutputText !!!!"></h:outputText>
>                 <h1>test</h1>
>                         <h5>H5</h5>
>         </tiles:putAttribute>

The problem is that inline content is evaluated and, after that, put
as a string in the attribute.
In your case, the <h:outputText> needs the <f:view> tag as a parent
(if I am not wrong). Since it cannot find it, it throws an exception.
The other solution (with the insertion of an URL) it works because it
works just like a <jsp:include>: the JSP code is evaluated in the
whole evaluation cycle.
IOW I think it is not a bug, but a characteristic you have to live with :-(

HTH
Antonio

==========================================================================

Thank you Antonio.
If the inline content is evaluated before it is inserted in the attribute, I
believe I have to embedded the jsf content in <f:view> or <f:subview> tag.
I used the <f:view> tag 
      
<tiles:putAttribute name="body">
        <f:view>
         <h:outputText value="hOutputText !!!!"></h:outputText>
                 <h1>test</h1>
                         <h5>H5</h5>
        </f:view>
</tiles:putAttribute>

But the inline content must be passed through. I'm getting following error:

Error during rendering
javax.servlet.jsp.JspException: Can't write content above <f:view> tag
Illegal to flush within a custom tag
        at
com.sun.faces.taglib.jsf_core.ViewTag.doStartTag(ViewTag.java:186)
...


Is it possible to handle the body content of <tiles:putAttribute> like the
<jsp:include> with an url (your second solution) ? This would be very nice
and avoids using 2 files...

Regards
Holger


Reply via email to