1)添加JAR之后, 创建一个JavaServer Faces项目并将该库集成到项目中。

文章图片
选择项目类型作为Web应用程序。

文章图片
【RichFaces开发应用程序示例图解】提供项目名称。

文章图片

文章图片

文章图片
选择框架作为JavaServer Faces。
2)现在, 选择我们在示例前面创建的库。

文章图片
完成后, 我们的项目结构应如下所示。

文章图片
好吧, 这一切都与配置有关。我们实际上不需要配置RichFaces。如果查看生成的项目中的web.xml文件, 将看不到RichFaces过滤器的内容。从RichFaces 4开始, 我们不需要在web.xml文件中注册过滤器。如果项目中存在RichFaces JAR, 则将使用RichFaces。
该项目包含两个默认的xhtml文件。第一个是index.xhtml, 第二个是welcomeRichfaces.xhtml。这两个文件具有以下代码。
// index.xhtml
<
?xml version='1.0' encoding='UTF-8' ?>
<
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html">
<
h:head>
<
title>
Facelet Title<
/title>
<
/h:head>
<
h:body>
Hello from Facelets
<
br />
<
h:link outcome="welcomeRichfaces" value="http://www.srcmini.com/Richfaces welcome page" />
<
/h:body>
<
/html>
// welcomeRichfaces.xhtml
<
?xml version='1.0' encoding='UTF-8' ?>
<
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml"
xmlns:rich="http://richfaces.org/rich"
xmlns:h="http://java.sun.com/jsf/html">
<
h:head>
<
title>
Richfaces Welcome Page<
/title>
<
/h:head>
<
h:body>
<
rich:panel header="Welcome to Richfaces">
RichFaces is an advanced UI component framework for easily integrating Ajax capabilities into business
applications using JSF.Check out the links below to lear more about using RichFaces in your application.
<
ul>
<
li>
<
h:outputLink value="http://richfaces.org">
Richfaces Project Home Page
<
/h:outputLink>
<
/li>
<
li>
<
h:outputLink value="http://showcase.richfaces.org">
Richfaces Showcase
<
/h:outputLink>
<
/li>
<
li>
<
h:outputLink value="https://community.jboss.org/en/richfaces?view=discussions">
User Forum
<
/h:outputLink>
<
/li>
<
li>
<
h:outputLink value="http://www.jboss.org/richfaces/docs">
Richfaces documentation...
<
/h:outputLink>
<
ul>
<
li>
<
h:outputLink
value="http://docs.jboss.org/richfaces/latest_4_X/Developer_Guide/en-US/html_single/">
Development Guide
<
/h:outputLink>
<
/li>
<
li>
<
h:outputLink
value="http://docs.jboss.org/richfaces/latest_4_X/Component_Reference/en-US/html/">
Component Reference
<
/h:outputLink>
<
/li>
<
li>
<
h:outputLink value="http://docs.jboss.org/richfaces/latest_4_X/vdldoc/">
Tag Library Docs
<
/h:outputLink>
<
/li>
<
/ul>
<
/li>
<
/ul>
<
/rich:panel>
<
/h:body>
<
/html>
3)运行项目

文章图片
运行index.xhtml文件之后。它产生以下输出:

文章图片
单击链接后, 它将重定向到welcomeRichfaces页面。

文章图片
推荐阅读
- RichFaces a4j(param组件示例)
- java用eclipse在使用fx包时导入import javafx.application.Application;显示错误
- appium 问题四的解决办法(模拟器打开的页面弹出框与脚本打开页面的弹出框不一致)
- android SDK-使用 AVD Manager.exe 创建虚拟机遇到报错 emulator - arm.exe 已停止工作 我的解决方案,记录下
- 复习Appium之Android自动化
- 安卓集成Unity开发示例
- Android.mk编译Helloworld
- 关于数据库查询new BeanPropertyRowMapper
- ValueError: must have exactly one of create/read/write/append mode