Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
JSF facelets portlet
Hi all!
Recently I've tried to enable Sample Sun JSF JSR-168 portlet to work with facelets in my test portlet. I've followed instructions described at: link to facelets tutorial
I downloaded Sample LR 4.2 faclets JSF portlet but it is Sample MyFaces facelets JSF portlet.
Do anybody have any working test example?
Down in this post are my web.xml, faces-config.xml and two xhtml pages. Deployment was successful without any error. When I add portlet in LR 4.1.1 layout, it displays just portlet frame, without any content and without any errors in log.
Ther are just next messages:
2007.01.10 10:27:13 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/servers/jakarta-tomcat-5.0.30_l_4.1.1_inv2/webapps/jsffacelets/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
2007.01.10 10:27:13 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/servers/jakarta-tomcat-5.0.30_l_4.1.1_inv2/webapps/jsffacelets/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
2007.01.10 10:27:13 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/servers/jakarta-tomcat-5.0.30_l_4.1.1_inv2/webapps/jsffacelets/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
2007.01.10 10:27:13 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/servers/jakarta-tomcat-5.0.30_l_4.1.1_inv2/webapps/jsffacelets/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
2007.01.10 10:27:13 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/servers/jakarta-tomcat-5.0.30_l_4.1.1_inv2/webapps/jsffacelets/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
If you have expirience plese help.
web.xml
portlet.xml
template.xhtml
faces-config.xml
Recently I've tried to enable Sample Sun JSF JSR-168 portlet to work with facelets in my test portlet. I've followed instructions described at: link to facelets tutorial
I downloaded Sample LR 4.2 faclets JSF portlet but it is Sample MyFaces facelets JSF portlet.
Do anybody have any working test example?
Down in this post are my web.xml, faces-config.xml and two xhtml pages. Deployment was successful without any error. When I add portlet in LR 4.1.1 layout, it displays just portlet frame, without any content and without any errors in log.
Ther are just next messages:
2007.01.10 10:27:13 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/servers/jakarta-tomcat-5.0.30_l_4.1.1_inv2/webapps/jsffacelets/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core.taglib.xml
2007.01.10 10:27:13 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/servers/jakarta-tomcat-5.0.30_l_4.1.1_inv2/webapps/jsffacelets/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml
2007.01.10 10:27:13 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/servers/jakarta-tomcat-5.0.30_l_4.1.1_inv2/webapps/jsffacelets/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml
2007.01.10 10:27:13 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/servers/jakarta-tomcat-5.0.30_l_4.1.1_inv2/webapps/jsffacelets/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml
2007.01.10 10:27:13 com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from: jar:file:/C:/servers/jakarta-tomcat-5.0.30_l_4.1.1_inv2/webapps/jsffacelets/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml
If you have expirience plese help.
web.xml
<!--?xml version="1.0" encoding="UTF-8"?-->
<web-app id="WebApp_ID">
<display-name>jsffacelets</display-name>
<context-param>
<param-name>company_id</param-name>
<param-value>igorb.com</param-value>
</context-param>
<!-- Use Documents Saved as *.xhtml -->
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<!-- Special Debug Output for Development -->
<context-param>
<param-name>facelets.DEVELOPMENT</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>javax.faces.application.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>false</param-value>
</context-param>
<listener>
<listener-class>com.liferay.portal.kernel.servlet.PortletContextListener</listener-class>
</listener>
<listener>
<listener-class>com.liferay.util.jsf.sun.faces.config.LiferayConfigureListener</listener-class>
</listener>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>
javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>jsffaceletstest</servlet-name>
<servlet-class>
com.liferay.portal.kernel.servlet.PortletServlet
</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>jsffaceletstest</servlet-name>
<url-pattern>/jsffaceletstest/*</url-pattern>
</servlet-mapping>
</web-app>
portlet.xml
<!--?xml version="1.0" encoding="UTF-8"?-->
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" id="jsffacelets.testPortlet.d606b16b90">
<portlet>
<portlet-name>jsffaceletstest</portlet-name>
<display-name>jsffaceletstest</display-name>
<portlet-class>com.sun.faces.portlet.FacesPortlet</portlet-class>
<init-param>
<name>com.sun.faces.portlet.INIT_VIEW</name>
<value>/facelets/guess.jsp</value>
</init-param>
<init-param>
<name>wps.markup</name>
<value>html</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<supported-locale>hr</supported-locale>
<portlet-info>
<title>jsffaceletstest</title>
</portlet-info>
</portlet>
</portlet-app>template.xhtml
<!--?xml version="1.0" encoding="UTF-8" ?-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<h1>
<ui:insert name="title">Default Title</ui:insert>
</h1>
<p>
<ui:insert name="body">Default Body</ui:insert>
</p>
<ui:composition template="/template.xhtml">
<ui:define name="title">
I'm thinking of a number from. Can you guess it?
</ui:define>
<ui:define name="body">
<h:form id="helloForm">
<h:inputtext type="text" id="userNo" />
<br>
<h:commandbutton type="submit" id="submit" action="success" value="Submit" />
<br>
<h:message showSummary="true" showDetail="false" style="color: red; font-weight: bold;" id="errors1" for="userNo" />
</h:form>
</ui:define>
</ui:composition>
faces-config.xml
<!--?xml version="1.0" encoding="UTF-8"?-->
<faces-config>
<application>
<view-handler>
com.sun.facelets.FaceletViewHandler
</view-handler>
</application>
</faces-config>
Community
Company
Feedback