JavaServer Faces in Action Example Code
Release 1.01 (11/01/2004)
This is the full set of source code for use with JavaServer Faces in Action by Kito D. Mann
(http://www.manning.com/mann/).
This code is released under the Apache Licese v2.0. See LICENSE-APACHE-2.txt for more information.
Several third-party libraries have been included, many of which have different licensing terms; see
THIRDPARTYLICENSE.TXT for details.
Organization
------------
This archive includes the following directories:
src - The primary Java source code
test - JUnit tests for some of the classes
classes.ant - Compiled classes
webapps - Contains WARs for all of the web applications
webapps/hello-world - The Hello, world! application
webapps/examples - Examples from Part 1 of the book
webapps/ptrack-ui - The ProjectTrack prototype from chapters 8 and 9
webapps/ptrack - The full ProjectTrack case study application from chapters 10-13
webapps/custom-components - Examples of the custom components, renderers, validators, and converters from
Parts 4 and 5
lib - Contains all third-party libraries and the custom component examples
(jia-custom-components.war). You can use the custom components in your
own projects by simply dropping jia-custom-components.war in your JSF
application's classpath (usually WEB-INF/lib).
custom-components - Configuration files for the custom components (used by build_components.xml)
Requirements
------------
These examples require JDK 1.3 or higher and a web container that supports the Servlet API 2.3 or
higher and JSP 1.2 or higher, such as Tomcat or WebSphere. They were tested with JDK 1.4 and
Tomcat 5.0 on Windows XP. If you have problems with other configurations, please let me know.
Running the samples
-------------------
The webapps directory has all of the WAR files; simply copy them to the appropriate directory
for your web container (for Tomcat, this is the webapps directory).
Building the sample code
------------------------
All of the code has already been built, but you can rebuild it (perhaps to include your
modifications to files in the src or test directories) by using Apache Ant (http://ant.apache.org).
There are five Ant build files in the root directory:
build.xml - Master build file (calls files below)
build_hello.xml - Build file for Hello, world!
Output: webapps/jia-hello-world.war
build_examples.xml - Buld file for Part 1 examples
Output: webapps/jia-examples.war
build_ptrack_ui.xml - Build file for ProjectTrack UI prototype
Output: webapps/jia-ptrack-ui.war
build_ptrack.xml - Build file for ProjectTrack case study
Output: webapps/jia-ptrack.war
build_components.xml - Build file for sample components
Output: lib/jia-custom-components.war
build_component_examples.xml - Build file for sample component examples
Output: webapps/jia-component-examples.war
To build the code, download and install Ant first if you haven't already. (You can get it
from http://ant.apache.org/bindownload.cgi). Once you've installed it, Ant should be
in your system path.
In order for the build to work properly, you must set the jdk.home property. You can do this either
by editing build.xml, or by specifying the property on the command line. So, if your JDK
home direcory is C:/jdk1.4, you would edit build.xml like so:
...
<property name="jdk.home" value="C:/jdk1.4"/>
...
You can then execute ant like this:
ant [target]
Alternatively, you set the property when you call the script:
ant -Djdk.home=C:\jdk1.4 [target]
Where [target] is either "make" or "rebuild" (the default is "rebuild").
You can call the other build scripts individually by using the buildfile parameter:
ant -buildfile build_ptrack.xml [target]
If you call individual build files, you must specify the jdk.home property for that build
file either by editing it or setting it on the command line, as shown above.
The code includes unit tests, but they are not executed by Ant at this time.
Custom Component notes
----------------------
If you wish to use the custom components in your own applications, be sure to
include the Informa library (for UIHeadlineViewer) and JUnit (if you intend
to run unit tests) in the application's classpath. These can be found in the
/lib directory.
ProjectTrack case study notes
---------------------------------------------
- As discussed in the book, ProjectTrack stores all of the objects in memory.
When you restart the application, you will loose all changes.
- Only partially localized for Russian
- The JDBC version of the Inbox page covered in chapter 13 is included for
example purposes, but doesn't really integrate with the rest of the application.
ProjectTrack uses the Hypersonic database for this example. In order for it to
work properly, you must change the org.jia.ptrack.databaseUrl context parameter in
ProjectTrack's web.xml to point to the location of the Hypersonic database, which
is in the WEB-INF directory. So, if ProjectTrack is deployed in C:/webapps/ptrack,
the org.jia.ptrack.databaseUrl context parameter in the file c:/webapps/ptrack/WEB-INF.web.xml
would be "c:/webapps/ptrack/WEB-INF/DATASET".
Additional notes
----------------
The JSPs are not pre-compiled, so the pages will load slowly the first time.
Bug fixes
---------
v1.01 11/3/2004
ProjectTrack (jia-ptrack.war)
- The visit property of authenticationBean should not be a managed property;
consequently the following declaration should be removed:
<managed-property>
<property-name>visit</property-name>
<value>#{sessionScope.visit}</value>
</managed-property>
The authenticationBean.visit property is set during AuthenticationBean.login method,
so it shouldn't be configured using managed beans.
- The entries for NoProjectAdapter and NoProjectAdapter_detail are not used, and should
be removed (they are artifacts of an older version of ProjectTrack).
- Removed reference to currentProjectAdapter in faces-config.xml and ptrackResources*.properties.
This was a class in an old version of ProjectTrack that no longer exists.
- In show_all.jsp, an HtmlCommandLink component has an incorrect value, which ah
<h:commandLink value="#{showAllBean.sort}" id="role"
styleClass="table-header"
actionListener="#{showAllBean.sort}">
<h:outputText value="Waiting for"/>
<f:param name="column" value="role"/>
</h:commandLink>
Has been changed to:
<h:commandLink id="role"
styleClass="table-header"
actionListener="#{showAllBean.sort}">
<h:outputText value="Waiting for"/>
<f:param name="column" value="role"/>
</h:commandLink>
- In create.jsp, the <h:selectOneMenu> declaration was missing the id attribute. Here's the correct
declaration:
<h:selectOneMenu id="typeSelectOne"
binding="#{createProjectBean.projectSelectOne}">
- Some debugging code in MemoryProjectCoordinator was throwing a DataStoreException whenever there
are exactly 5 projects.
- CreateProjectBean.add now returns either success_readonly or success_failure, which
matches the navigation rules.
Known Issues
------------
UINavigator custom comp
没有合适的资源?快使用搜索试试~ 我知道了~
JSF IN ACTION 源代码
共541个文件
class:159个
java:86个
jsp:78个
5星 · 超过95%的资源 需积分: 9 418 下载量 69 浏览量
2007-10-10
13:46:00
上传
评论
收藏 28.84MB ZIP 举报
温馨提示
JSF IN ACTION (源代码) 以前上传的书的源代码.......IN Action书的代码都可以在Manning 的官方网站(www.manning.com)上可以下载得到..希望大家喜欢
资源推荐
资源详情
资源评论
收起资源包目录
JSF IN ACTION 源代码 (541个子文件)
TestForm.class 13KB
UIDebug.class 10KB
UIHeadlineViewer.class 10KB
UINavigator.class 9KB
MemoryProjectCoordinator.class 8KB
MemoryProjectCoordinator.class 8KB
UIInputDate.class 8KB
ToolbarRenderer.class 7KB
UserConverter.class 7KB
TestUserConverter.class 7KB
TestProjectCoordinator.class 7KB
TestProjectCoordinator.class 7KB
HeadlineViewer_TableTag.class 6KB
Navigator_ToolbarTag.class 6KB
TestProject.class 5KB
TestProject.class 5KB
SelectProjectBean.class 5KB
SelectProjectBean.class 5KB
HtmlBaseTag.class 5KB
CreateProjectBean.class 5KB
SelectProjectResultSetBean.class 5KB
SelectProjectResultSetBean.class 5KB
CreateProjectBean.class 5KB
Project.class 5KB
Project.class 5KB
Utils.class 5KB
Utils.class 5KB
Util.class 5KB
Util.class 5KB
TestChannelDataModel.class 5KB
NavigatorItemTag.class 5KB
Command_RolloverButtonDecoratorTag.class 4KB
Command_RolloverButtonTag.class 4KB
AddHeaders.class 4KB
AuthenticationBean.class 4KB
EscapeHtmlTag.class 4KB
AuthenticationBean.class 4KB
UserBean.class 4KB
RolloverButtonDecoratorRender.class 4KB
RolloverButtonRenderer.class 4KB
TestOperation.class 4KB
TestOperation.class 4KB
EnumItemAdapter.class 4KB
EnumItemAdapter.class 4KB
InputDateTag.class 4KB
AuthorizationFilter.class 3KB
AuthorizationFilter.class 3KB
Utils.class 3KB
TestResultSetProjectCoordinator.class 3KB
ListWrapper.class 3KB
Utils.class 3KB
UpdateProjectBean.class 3KB
UpdateProjectBean.class 3KB
RegularExpressionValidator.class 3KB
TestResultSetProjectCoordinator.class 3KB
Visit.class 3KB
Visit.class 3KB
MemoryStatusCoordinator$BasicStatus.class 3KB
MemoryStatusCoordinator$BasicStatus.class 3KB
UINavigator$NavigatorActionListener.class 3KB
ArtifactTypeConverter.class 3KB
ArtifactTypeConverter.class 3KB
MemoryStatusCoordinator.class 3KB
MemoryStatusCoordinator.class 3KB
ProjectTypeConverter.class 3KB
ProjectTypeConverter.class 3KB
ResultSetProjectCoordinator.class 3KB
ResultSetProjectCoordinator.class 3KB
TestRSS.class 3KB
UserConverterTag.class 3KB
HtmlTableBaseTag.class 3KB
UtilsTest.class 3KB
ChannelDataModel.class 3KB
UtilsTest.class 3KB
TestEnumAdapter.class 3KB
TestEnumAdapter.class 2KB
NavigatorLoggingActionListener.class 2KB
EnumeratedType$EnumManager.class 2KB
EnumeratedType$EnumManager.class 2KB
HelloBean.class 2KB
TestArtifactTypeConverter.class 2KB
BaseBean.class 2KB
BaseBean.class 2KB
TestProjectTypeConverter.class 2KB
DebugTag.class 2KB
MemoryUserCoordinator.class 2KB
MemoryUserCoordinator.class 2KB
TestArtifactTypeConverter.class 2KB
TestProjectTypeConverter.class 2KB
NavigatorItemList.class 2KB
MemoryProjectCoordinator$ProjectComparator.class 2KB
Initializer.class 2KB
Initializer.class 2KB
AnimalForm.class 2KB
MemoryProjectCoordinator$ProjectComparator.class 2KB
NavigatorItem.class 2KB
TestCurrency.class 2KB
RegexpValidatorTag.class 2KB
BaseException.class 2KB
BaseException.class 2KB
共 541 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
- jarlcox2013-12-09不错,内容还可以的
ckangtai
- 粉丝: 41
- 资源: 458
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功