`
Arron.li
  • 浏览: 136066 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

tomahawk+richfaces+facelets整合

    博客分类:
  • JSF
阅读更多

The guidance to configure the myfaces and richfaces

1 Overview

After almost three weeks, the project about myfaces and richfaces compability is success.

I hope this artical will help you save some developing time.

 

2 this project required all .jar list is in the affix

all .jar list

 

 

3 configure the web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
  <description>JSF Demo</description>
  <display-name>JSF Demo</display-name>
  <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
  </context-param>
  
	<context-param>
        <param-name>facelets.LIBRARIES</param-name>
        <param-value>/WEB-INF/facelets/tag/facelets.taglib.xml</param-value>
    </context-param>  
  <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
  </context-param>
  <context-param>
    <param-name>facelets.REFRESH_PERIOD</param-name>
    <param-value>2</param-value>
  </context-param>
  <context-param>
    <param-name>facelets.DEVELOPMENT</param-name>
    <param-value>true</param-value>
  </context-param>
  	<context-param>
		<param-name>org.ajax4jsf.SKIN</param-name>
		<param-value>blueSky</param-value>
	</context-param>
  
  <filter>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
    <init-param>
      <param-name>uploadMaxFileSize</param-name>
      <param-value>20m</param-value>
      <description>Set the size limit for uploaded files.
	            Format: 10 - 10 bytes
	                    10k - 10 KB
	                    10m - 10 MB
	                    1g - 1 GB</description>
    </init-param>
  </filter>
  <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages  -->
  <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
    <servlet-name>Faces Servlet</servlet-name>
  </filter-mapping>
  <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.)  -->
  <filter-mapping>
    <filter-name>MyFacesExtensionsFilter</filter-name>
    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
  </filter-mapping>
  <filter>
    <display-name>RichFaces Filter</display-name>
    <filter-name>richfaces</filter-name>
    <filter-class>org.ajax4jsf.Filter</filter-class>
    <init-param> 
<param-name>createTempFiles </param-name> 
<param-value>true</param-value> 
</init-param> 
<init-param> 
<param-name>maxRequestSize </param-name> 
<param-value>10000000 </param-value> 
</init-param> 
  </filter>
  <filter-mapping>
    <filter-name>richfaces</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>FORWARD</dispatcher>

    <dispatcher>REQUEST</dispatcher>
  </filter-mapping>
  <listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</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-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>index.xhtml</welcome-file>
  </welcome-file-list>
  <login-config>
    <auth-method>BASIC</auth-method>
  </login-config>
  
</web-app>

  4 configure the faces-config.xml

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC
 "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
 "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">

<faces-config>
		<application>
			<locale-config>
				<default-locale>en</default-locale>
			</locale-config>
			<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
		</application>




</faces-config>

  5 pom.xml config

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.talgroup.myfaces</groupId>
  <artifactId>myfaces_mvn</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>myfaces_mvn Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
	     <dependency>
	    <groupId>org.apache.myfaces.core</groupId>
	    <artifactId>myfaces-impl</artifactId>
	    <version>1.2.5</version>
		</dependency> 
		 <dependency>
		    <groupId>org.apache.myfaces.core</groupId>
		    <artifactId>myfaces-api</artifactId>
		    <version>1.2.5</version>
		</dependency> 
		<dependency>
		    <groupId>org.apache.myfaces.tomahawk</groupId>
		    <artifactId>tomahawk</artifactId>
		    <version>1.1.8</version>
		</dependency> 

		<dependency>
			<groupId>commons-fileupload</groupId>
			<artifactId>commons-fileupload</artifactId>
			<version>1.2.1</version>
		</dependency>		
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>1.4</version>
		</dependency>
       <dependency>
          <groupId>commons-codec</groupId>
          <artifactId>commons-codec</artifactId>
           <version>1.3</version>
        </dependency> 
	    <dependency>
	       <groupId>commons-discovery</groupId>
	       <artifactId>commons-discovery</artifactId>
	       <version>0.4</version>
	     </dependency> 
     	<dependency>
			<groupId>commons-beanutils</groupId>
			<artifactId>commons-beanutils</artifactId>
			<version>1.7.0</version>
		</dependency>
		<dependency>
			<groupId>commons-digester</groupId>
			<artifactId>commons-digester</artifactId>
			<version>1.8</version>
		</dependency>
		<dependency>
			<groupId>commons-collections</groupId>
			<artifactId>commons-collections</artifactId>
			<version>3.2.1</version>
		</dependency>
		<dependency>
            <groupId>commons-lang</groupId>
              <artifactId>commons-lang</artifactId>
            <version>2.1</version>
        </dependency> 
        <dependency>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging</artifactId>
			<version>1.0.4</version>
			<exclusions>
				<exclusion>
					<groupId>javax.servlet</groupId>
					<artifactId>servlet-api</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
       <dependency>
			<groupId>jstl</groupId>
			<artifactId>jstl</artifactId>
			<version>1.1.2</version>
		</dependency>
		

		<dependency>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging</artifactId>
			<version>1.0.4</version>
			<exclusions>
				<exclusion>
					<groupId>javax.servlet</groupId>
					<artifactId>servlet-api</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>com.sun.facelets</groupId>
			<artifactId>jsf-facelets</artifactId>
			<version>1.1.14</version>
			<optional>false</optional>
		</dependency>
		
		<dependency>
			<groupId>javax.el</groupId>
			<artifactId>el-api</artifactId>
			<version>1.0</version>
		</dependency>
		<dependency>
			<groupId>javax.el</groupId>
			<artifactId>el-ri</artifactId>
			<version>1.2</version>
		</dependency>
	
		<dependency>
			<groupId>org.richfaces.framework</groupId>
			<artifactId>richfaces-impl</artifactId>
			<version>3.2.2.GA</version>
		</dependency>
		<dependency>
			<artifactId>richfaces-api</artifactId>
			<groupId>org.richfaces.framework</groupId>
			<version>3.2.2.GA</version>
		</dependency>
		<dependency>
			<groupId>org.richfaces.ui</groupId>
			<artifactId>richfaces-ui</artifactId>
			<version>3.2.2.GA</version>
		</dependency>		
  </dependencies>
  <build>
    <finalName>myfaces_mvn</finalName>
   		<defaultGoal>package</defaultGoal>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.5</source>
					<target>1.5</target>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<configuration>
					<artifactItems>
						<artifactItem>
							<groupId>${project.groupId}</groupId>
							<artifactId>
								${project.artifactId}
							</artifactId>
							<version>${project.version}</version>
							<type>${project.packaging}</type>
							<overWrite>true</overWrite>
							<outputDirectory>
								${artifactsDir}
							</outputDirectory>
						</artifactItem>
					</artifactItems>
				</configuration>
			</plugin>
		</plugins>
  </build>
  <distributionManagement>
		<repository>
			<id>releases</id>
			<url>
				dav:http://192.168.106.129:28080/artifactory/libs-releases
			</url>
		</repository>

	</distributionManagement>
</project>
 

2
1
分享到:
评论
2 楼 Arron.li 2009-04-13  
没错,richface的标签确实好用的多,而且也很漂亮,我之所以研究myfaces,使我们在项目开发前想同时吸收myface与richface的综合优势,后来经过验证,最终选择了richface
1 楼 RockyWoo 2009-04-09  
这两个的整合主要是在web.xml配置文件上,其他的使用方法与jsf大同小异!个人觉得Richface的标签挺好用的,而且有默认样式!对于对标签样式调整很恶心的人,使用非常好!

相关推荐

    tomahawk-facelets:Facelets 支持 Apache MyFaces Tomahawk

    tomahawk-facelets Facelets 支持 Apache MyFaces Tomahawk 注意:从 1.1.7 版开始,Facelets 支持已集成到 Tomahawk 中。 我们建议您至少升级到此版本的 Tomahawk。 该库将不再积极维护。 但是,如果有人仍在使用它...

    richfaces.jar

    描述中提到的“richfaces收购了myfaces”,实际上是指RichFaces组件库在某种程度上整合了MyFaces Tomahawk的功能,使得开发者可以在一个框架内享受更广泛和强大的组件支持。这种融合使得开发者可以更容易地实现复杂...

    tomahawk-1.1.8.jar

    tomahawk-1.1.8.jar,tomahawk-1.1.8.jar,tomahawk-1.1.8.jar

    tomahawk-1.1.8-bin.zip

    《深入解析Tomahawk 1.1.8在JSF 1.1中的应用》 Tomahawk 1.1.8-bin.zip是一款基于JavaServer Faces (JSF) 1.1框架的开源组件库,它由Apache MyFaces社区开发并维护。这个压缩包包含了Tomahawk 1.1.8版本的所有必要...

    JSF+Spring+Hibernate Hello学习程序

    自己学习JSF, Spring, Hiebernate的 HelloWorld程序,开发环境MyEclipse,含有Tomahawk、RichFaces部分集成实例。具体包括登录、注册、树控件、日历等。可用作平时学习之用! 由于大小的限制,缺少的包请到相关...

    tomahawk src

    "Tomahawk src"指的是Tomahawk项目的源代码,它是一个专为JavaServer Faces (JSF) 2.0框架设计的组件库。这个组件库提供了丰富的UI元素和功能,帮助开发者构建用户界面。版本1.1.13是这个特定源代码的发行版本。 ...

    tomahawk jar

    标题中的“tomahawk jar”指的是Tomahawk库的Java Archive (JAR) 文件,这个版本是1.1.13,专门针对JSF 2.0框架设计。JSF是一种Java EE标准,用于构建可维护、可扩展的Web用户界面,而Tomahawk库则增强了JSF的功能,...

    tomahawk12-1.1.13-src.tar.gz

    《深入探索Tomahawk网络工具:从源码到实践》 Tomahawk,作为一个网络工具,相较于tcpreplay在某些方面表现出更为优越的性能和易用性,这使得它成为了网络流量回放和分析领域的一颗耀眼新星。在本文中,我们将详细...

    tomahawk20-1.1.11-bin.zip

    标题中的"tomahawk20-1.1.11-bin.zip"是一个软件包,它很可能包含Tomahawk项目的特定版本(1.1.11)的二进制文件。Tomahawk通常指的是Apache MyFaces Tomahawk项目,这是一个开源JavaServer Faces (JSF)组件库,提供...

    tomahawk-1.1.0.jar

    tomahawk包,用于JAVA开发的JAR包,网站页面组件开发

    tomahawk-1.1.3

    "Tomahawk-1.1.3" 是一个软件版本号,这通常指的是某个特定的迭代或更新,可能包含性能优化、新功能的添加或已知问题的修复。在这个上下文中,"Tomahawk"很可能是一款专为IT行业设计的应用程序,可能是音乐播放器、...

    richFaces帮助文档

    - **Tomahawk**:提供了一组额外的组件。 此外,还支持JBoss Seam等框架,以增强应用的功能性和灵活性。 ##### 2.3 支持的服务器 支持的服务器包括但不限于: - **Apache Tomcat** - **JBoss AS / WildFly** - *...

    tomahawk-sandbox配置

    用的是tomahawk-sandbox。代码很简单就是配置很麻烦。晚上的大多都没有提供jar包,所以即使你配置错误也会出现错误。我将配置的信息整理,做了demol,jar包截图整理文档,把我遇到的错误误区整理一下。

    tomahawk1.1

    一款用于测试入侵防御系统(IPS)的工具,值得学习。

    tomahawk12-1.1.8-bin

    "Tomahawk12-1.1.8-bin" 是一个特定版本的开源Java服务器页面(JSP)组件集合,主要包含JSF(JavaServer Faces)分页控件和其他相关控件。这个压缩包文件“tomahawk12-1.1.8-bin.zip”显然是为了方便开发人员下载和...

    tomahawk-源码.rar

    《深入剖析Tomahawk源码》 Tomahawk,这个名字源于美洲原住民的一种战斧,作为软件领域的项目,它代表了一种强大的工具或者框架。本文将深入探讨Tomahawk的源码,揭示其内在的设计理念和技术实现,帮助开发者更好地...

    100%雷蛇血统的机壳来了!! Razer TOMAHAWK ATX机壳开箱评测

    【Huan】_100%雷蛇血統的機殼來了!!_Razer_TOMAHAWK_ATX機殼開箱評測

    tomahawk JSF reference pdf

    ### Tomahawk JSF Reference PDF概述 在JavaServer Faces (JSF)的生态系统中,《Tomahawk JSF Reference PDF》是一份重要的参考资料,为开发者提供了关于Tomahawk组件库的全面指南。这份文档包含了对Tomahawk标签库...

    jsf+spring2.5+jpa(hibernate)的jar包

    这是jsf+spring2.5+jpa(hibernate)的jar包,很多人为了jsj环境而配置半天,在此提供jar包共享。注:除了ajax4jsf和tomahawk-1.1.3.jar,因为csdn只让我上传20mb,大家自己可以下一下自己试试。

Global site tag (gtag.js) - Google Analytics