<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Access to a bean when using facelets as template"]]></title>
		<link>http://forums.hotjoe.com/posts/list/9.page</link>
		<description><![CDATA[Latest messages posted in the topic "Access to a bean when using facelets as template"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Access to a bean when using facelets as template</title>
				<description><![CDATA[  	<br /> Hi!<br /> <br /> I'm starting to develop an application on netbeans+glassfish+mysql.<br /> <br /> I've created a facelet template to have only one time all the design part:<br /> <br /> [code]&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br />  <br /> &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;<br /> &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"&gt;<br />     &lt;head&gt;<br />         &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/&gt;<br />         &lt;title&gt;TrustBN - #{title}&lt;/title&gt;<br />     &lt;/head&gt;<br />     &lt;body&gt;<br />         &lt;p&gt;<br />             &lt;ui:define name ="body"/&gt;<br />         &lt;/p&gt;<br />     &lt;/body&gt;<br /> &lt;/html&gt;<br /> [/code]<br /> <br /> After this I just create a JSF page:<br /> <br /> [code]&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br /> &lt;!-- <br />     Document   : testfile<br />     Created on : 18 juin 2009, 14:20:02<br />     Author     : J4N<br /> --&gt;<br /> &lt;jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"  <br /> xmlns:ui="http://java.sun.com/jsf/facelets"<br /> xmlns:f="http://java.sun.com/jsf/core" <br /> xmlns:h="http://java.sun.com/jsf/html" version="2.0"&gt;<br />  <br />     &lt;jsp:directive.page contentType="text/html" pageEncoding="UTF-8"/&gt;<br /> &lt;f:view&gt;<br />         &lt;ui:composition template="/WEB-INF/template.xhtml"&gt;<br />             &lt;ui:param name="title" value="toto"/&gt;            <br />             &lt;ui:define name="body"&gt;<br />                 &lt;h:outputText&gt;#{testfile2.toto}&lt;/h:outputText&gt;<br />             &lt;/ui:define&gt;<br />         &lt;/ui:composition&gt;<br />     &lt;/f:view&gt;<br /> &lt;/jsp:root&gt;<br /> [/code]<br /> But I get this error:<br /> <br /> org.apache.jasper.JasperException: PWC6228: #{...} not allowed in a template text body.<br /> <br /> on the #{testfile2.toto}<br /> <br /> I've try to do:<br /> -The same thing without the template<br /> -The same thing without the #{...}<br /> <br /> And the two things works.<br /> <br /> Must we use a special method to access to bean when we use facelets? Is it impossible? What do you recommend me? ]]></description>
				<guid isPermaLink="true">http://forums.hotjoe.com/posts/preList/601/2317.page</guid>
				<link>http://forums.hotjoe.com/posts/preList/601/2317.page</link>
				<pubDate><![CDATA[Thu, 18 Jun 2009 13:27:03]]> GMT</pubDate>
				<author><![CDATA[ nargzul]]></author>
			</item>
	</channel>
</rss>
