The Struts-Faces Integration Library (Version 1.0) README File
$Id: README.txt 400336 2006-05-06 17:02:20Z wsmoak $
============
INTRODUCTION:
============
This package contains an add-on library that supports the use of
JavaServer Faces (JSF) user interface technology in a Struts based web
application, in place of the Struts custom tag libraries.
The Struts-Faces Integration Library should work with any implementation
of JavaServer Faces, version 1.0 or later. It has primarily been tested
against version 1.1 of the JavaServer Faces reference implementation,
available at:
http://java.sun.com/j2ee/javaserverfaces/
========================
NEW AND REVISED FEATURES:
========================
* As of the nightly build 20040902, the URI for the struts-faces tag library
has changed. You should now be using:
<%@ taglib prefix="s" uri="http://struts.apache.org/tags-faces" %>
instead of:
<%@ taglib prefix="s" uri="http://jakarta.apache.org/struts/tags-faces" %>
* It is now possible to mix pure JavaServer Faces pages, and those
using the struts-faces integration library, in the same webapp. Previously,
it was required to use only Struts-based handlers for form submits.
* All attributes of the component tags in the Struts-Faces integration library
have been "value binding enabled", meaning you can use value binding
expressions ("#{...}") to calculate attribute values dynamically.
* It is now possible to use the Struts-Faces Integration Library in conjunction
with application modules using Tiles.
* You may now use a managed bean named "struts" at the beginning of any
value binding expression in order to gain access to request, session, and
application scope objects provided by Struts. See the Javadocs for the
implementation class (org.apache.struts.faces.util.StrutsContext)
for more information about what objects are available.
* You may now use either prefix mapping (/faces/*) or extension mapping
(*.faces) for the JavaServer Faces controller servlet.
* In addition to the <s:message> tag that operates as a direct replacement
for <html:message>, you may also consider using the new <s:loadMessages>
tag that exposes a MessageResources instance as a request attribute
containing a Map. This makes the messages included in the instance
available via value binding expressions (or JSP 2.0 EL expressions).
For example, the logon.jsp page of the example application includes:
...
<s:loadMessages var="messages"/>
...
<h:outputText value="#{messages['logon.header']}"/>
...
to create the header text for the logon form. You may either specify the
application scope key for the MessageResources bunde you want, or omit
the "messages" attribute to load the default MessageResources for the
current application module.
* You can leverage advanced JavaServer Faces features in a Struts based
web application. For example, the converted "Mail Reader" example includes
using the <h:dataTable> for multi-row input as well as output.
* If your Struts application stores a Locale in the session attribute
named Globals.LOCALE_KEY (i.e. using the usual Struts technique for
establishing a user specific locale), this setting will be copied to
the UIViewRoot of the corresponding JSF view, which will therefore
cause it to change the Locale used by JSF components and renderers also.
* New command link component (and associated <s:commandLink> tag that mirrors
the functionality of the standard <h:commandLink> component, but works when
inside a Struts <s:form> component.
This release of the Struts-Faces Integration Library (Version 1.0) has the
following revised features relative to the previous (0.4) release:
* The "focus" attribute on the <s:form> tag should work properly
in all cases now.
* Integration with the Validator Framework should work properly
in all cases now.
=======================================================
USING THE STRUTS-FACES LIBRARY IN YOUR OWN APPLICATIONS:
=======================================================
Using the Struts-Faces integration library in your own Struts-based web
applications is straightforward, and requires the following steps:
* Add the "struts-faces.jar" file from the "lib" subdirectory of this
release into the "/WEB-INF/lib" subdirectory of your webapp.
* Add the following JAR files from the JavaServer Faces reference
implementation's "lib" directory to your application's
"/WEB-INF/lib" directory: jsf-api.jar, jsf-impl.jar,
or install them in your servlet container's shared folder.
(You can also use any other JSF implementation that has
been certified to be compatible with the JSF specification.)
* Add the following JAR files, containing the JSTL release (or
from the JavaServer Faces release) to your application's
"/WEB-INF/lib" directory: jstl.jar, standard.jar, or
install them in your servlet container's shared folder.
* Add the servlet definition for the JavaServer Faces servlet into
your web application's deployment descriptor (/WEB-INF/web.xml):
<servlet>
<servlet-name>faces</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
* If you have a <load-on-startup> element on your declaration of the
Struts controller servlet, modify the value to be "2" or greater
so that FacesServlet is initialized first.
* Add the servlet mapping for the JavaServer Faces servlet into
your web application's deployment descriptor (/WEB-INF/web.xml):
<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
* The tag library in the Struts-Faces integration library (as well
as those in the JavaServer Faces reference implementation) are
embedded in the JAR files themselves, and rely on the ability of a
Servlet 2.3 (or later) container to automatically recognize them.
Therefore, there is no need to copy the TLD files into the WEB-INF
subdirectory of your web application.
* Modify the JSP pages of your web application to use the JSTL,
JavaServer Faces, and Struts-Faces integration library tags, instead
of the traditional Struts tag libraries. This migration can occur
one page at a time, as you become familiar with the new technologies.
You will want to note the following points in particular:
- Include the following tag library directives at the top of your
page in order to declare them:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@ taglib prefix="s" uri="http://struts.apache.org/tags-faces" %>
- The Struts-Faces tag library (prefix "s" above) contains replacements
for functionality in the existing Struts HTML tag library that are
not directly provided by JavaServer Faces components. You should
convert your existing use of the Struts HTML variants of these tags
to use the Struts-Faces version instead. (Functionality and attributes
should be basically compatible, so this is usually just a matter of
changing the tag prefixes.)
- In particular, you must use the Struts-Faces version of the
form tag (<s:form>) in order to activate standard Struts features
like automatic creation of the form bean, and looking up the
appropriate action to invoke based on the "action" attribute.
- Replace the use of tags from the Struts HTML library with user interface
component tags provided by the JavaServer Faces reference implementation,
by other third party libraries, or by your application itself. For
example, on the logon.jsp page, the username field was change
没有合适的资源?快使用搜索试试~ 我知道了~
Struts的一些例子
共1371个文件
java:641个
xml:232个
jsp:163个
5星 · 超过95%的资源 需积分: 3 16 下载量 130 浏览量
2008-10-15
08:54:18
上传
评论
收藏 25.13MB ZIP 举报
温馨提示
Struts的一些例子Struts的一些例子Struts的一些例子
资源推荐
资源详情
资源评论
收起资源包目录
Struts的一些例子 (1371个子文件)
stylesheet.css 4KB
stylesheet.css 2KB
base.css 2KB
base.css 2KB
example.css 1KB
WebTest.dtd 166KB
WebTest.dtd 166KB
struts-config_1_3.dtd 36KB
struts-config_1_1.dtd 36KB
struts-config_1_2.dtd 35KB
web-app_2_3.dtd 33KB
struts-config_1_0.dtd 19KB
tiles-config_1_3.dtd 13KB
tiles-config_1_1.dtd 13KB
newbie.fml 57KB
faq.fml 26KB
kickstart.fml 15KB
faq.fml 2KB
ValidWhenParser.g 7KB
nested-logic.gif 30KB
nested-html.gif 30KB
tilesUML.gif 22KB
tilesUML.gif 16KB
htmlUML.gif 16KB
actionUML.gif 15KB
logicUML.gif 14KB
configUML.gif 13KB
beanUML.gif 13KB
nestedUML.gif 12KB
nested-bean.gif 9KB
actionsUML.gif 6KB
Stamp.gif 5KB
T1.gif 4KB
T2.gif 4KB
jakarta-feather-small.gif 2KB
struts-power.gif 2KB
struts-power.gif 2KB
struts-power.gif 2KB
struts-power.gif 2KB
struts-power.gif 2KB
execute.gif 1KB
return.gif 1KB
image001.gif 1KB
jsp.gif 999B
code.gif 292B
SaveRegistration.gv 5KB
SaveSubscription.gv 4KB
EditSubscription.gv 3KB
EditRegistration.gv 3KB
Logon.gv 3KB
Locale.gv 2KB
Welcome.gv 2KB
Logoff.gv 2KB
tour.htm 45KB
tour.htm 45KB
tour.html 78KB
tour.html 78KB
package.html 37KB
package.html 24KB
package.html 22KB
package.html 22KB
package.html 17KB
package.html 16KB
package.html 10KB
package.html 5KB
index.html 4KB
package.html 3KB
package.html 3KB
package.html 2KB
package.html 2KB
package.html 2KB
package.html 2KB
package.html 2KB
package.html 2KB
package.html 1KB
package.html 1KB
index.html 1KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 1KB
package.html 1021B
package.html 1015B
package.html 1014B
package.html 1007B
package.html 996B
package.html 990B
package.html 981B
package.html 970B
include.inc 962B
TestTagUtils.java 74KB
ActionServlet.java 72KB
FieldChecks.java 51KB
TagUtils.java 44KB
RequestProcessor.java 42KB
RequestUtils.java 41KB
ActionConfig.java 40KB
TestActionServlet.java 39KB
ELImgTag.java 37KB
ELLinkTag.java 35KB
共 1371 条
- 1
- 2
- 3
- 4
- 5
- 6
- 14
资源评论
- ricky58002012-10-31不错的东西,是初学者值得学习的东西。
hjc00
- 粉丝: 7
- 资源: 63
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功