-
1. Re: Richface and Facelets Template work together
ozbluesky Sep 22, 2010 8:07 PM (in response to ozbluesky)Not getting any answer here, does this mean it's not possible to use template with Richfaces?
-
2. Re: Richface and Facelets Template work together
volothamp Sep 23, 2010 3:49 AM (in response to ozbluesky)Yes it's possible. Would you please post the web.xml file?
-
3. Re: Richface and Facelets Template work together
kanal Sep 23, 2010 5:53 AM (in response to ozbluesky)River Zhu wrote:
(...) does this mean it's not possible to use template with Richfaces?
It is possible to use them together.
Right now I'm using facelets and richfaces.
Maybe you downloaded wrong version of richfaces. You should use version 4.x for JSF2 (which uses facelets instead of JSP pages like it was in JSF 1.2 and lower).
-
4. Re: Richface and Facelets Template work together
amarkhel Sep 24, 2010 9:42 AM (in response to ozbluesky)I guess problem in wrong configuration of web.xml, something like wrong view-handler declaration. Put your web.xml please
-
5. Re: Richface and Facelets Template work together
ozbluesky Sep 24, 2010 1:34 PM (in response to volothamp)Thanks for responding, this will definitely help me. I tried on both JSF1.2 and JSF2.0, both are not working:
For JSF1.2, jar files I included are:
- richfaces-api-3.3.3.Final.jar
- richfaces-impl-3.3.3.Final.jar
- richfaces-ui-3.3.3.Final.jar
- commons-beanutils-1.7.0.jar
- commons-collections-3.2.1.jar
- commons-digester-1.8.jar
- commons-logging-1.0.4.jar
- jhighlight-1.0.jar
For JSF2, I included same set of files except replace richfaces-impl-3.3.3.Final.jar with richfaces-impl-jsf2-3.3.3.Final.jar
Here is web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/greeting.xhtml</welcome-file>
</welcome-file-list><!-- Template stopped working once I added below part -- >
<!-- Plugging the "Blue Sky" skin into the project -->
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
<!-- Making the RichFaces skin spread to standard HTML controls -->
<context-param>
<param-name>org.richfaces.CONTROL_SKINNING</param-name>
<param-value>enable</param-value>
</context-param><!-- Defining and mapping the RichFaces filter -->
<filter>
<display-name>RichFaces Filter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<context-param>
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param></web-app>
- richfaces-api-3.3.3.Final.jar
-
6. Re: Richface and Facelets Template work together
nbelaevski Sep 26, 2010 10:34 PM (in response to ozbluesky)Hi River,
Just to clarify: are Facelets 1.1.x (.jar file) present in your JSF 1.2 & 2.0 configurations?
-
7. Re: Richface and Facelets Template work together
nbelaevski Sep 26, 2010 10:36 PM (in response to kanal) -
8. Re: Richface and Facelets Template work together
ozbluesky Sep 28, 2010 1:46 AM (in response to nbelaevski)Initially I didn't have Facelet plug-in in my NetBeanm 6.9.1. It works as long as RichFaces is not included.
Then I installed Netbean Plugin Facelets 1.1.14 (JSF 1.2), and include "JSF 1.2 + Facelets 1.1.14" library, which add org-netbeans-modules-web-facelets010114.jar to libraries, it also works as long as RichFaces is not used.
However, as soon as I configure project with RichFaces, neither of them would work.
I've seen lots of samples using Facelet, but still not able to make it work for me. My files are attached.
Thanks for help
-
web.xml 1.7 KB
-
greeting.xhtml.zip 444 bytes
-
header.xhtml.zip 362 bytes
-
template.xhtml.zip 632 bytes
-
-
9. Re: Richface and Facelets Template work together
amarkhel Sep 28, 2010 6:37 AM (in response to ozbluesky)Do you have faces-config.xml file in your project?
Here example of this file, needed to proper work of facelets:
<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
<application>
<locale-config>
<default-locale>en</default-locale>
<supported-locale>fr</supported-locale>
</locale-config>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application> -
10. Re: Richface and Facelets Template work together
ozbluesky Sep 28, 2010 1:48 PM (in response to amarkhel)Thanks Andrey, faces-config.xml was not generated by default by Netbean. (for any reason?)
I created one using it's default version="2.0", and added <view-handler>. The template starts working for both JSF1.2 and JSF 2.0. It needn't Facelets 1.1.14 plug-in, which add org-netbeans-modules-web-facelets010114.jar to libraries. (It's an extra step I tried earlier.)
faces-config.xml
<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"><view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</faces-config>I did more test on JSF 2.0, my findings are:
1. I cannot turn off VDL viewhandler as Ilya's artical "RichFaces 3.3.3 and JSF 2.0" by adding following code in web.xml. It make template not working. Will this cause any problem later on?
<context-param>
<param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
<param-value>true</param-value>
</context-param>2. It's ok to have following code from Richface developer guide 4.4 facelet support. However, it didn't make a difference. Are they doing same thing?
<context-param>
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>Regards,
River