mirror of
https://github.com/apache/struts.git
synced 2026-08-05 22:56:59 +00:00
Initial import of WebWork 2, version 2.2.2
git-svn-id: https://svn.apache.org/repos/asf/incubator/webwork2@388283 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
+824
@@ -0,0 +1,824 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4" relativePaths="true" type="JAVA_MODULE">
|
||||
<component name="ModuleRootManager" />
|
||||
<component name="NewModuleRootManager">
|
||||
<output url="file://$MODULE_DIR$/build/java" />
|
||||
<exclude-output />
|
||||
<exclude-exploded />
|
||||
<output-test url="file://$MODULE_DIR$/build/test" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/dist" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/docs/chinese" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/docs/wikidocs" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="module" module-name="XWork" exported="" />
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/default/freemarker.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/quickstart/jasper-compiler-jdt.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/quickstart/xstream.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/pico/nanocontainer.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/velocity/commons-collections.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/hibernate/hibernate.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/hibernate/commons-logging.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/bootstrap/clover-license.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/bootstrap/commons-httpclient.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/plexus/plexus-container-default.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/jasperreports/jasperreports.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/build/mockobjects-core.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/hibernate/ehcache.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/default/commons-logging.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/bootstrap/ivy-1.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/spring/spring-core.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/sitemesh/sitemesh.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/build/mockobjects-jdk1.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/jasperreports/itext.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/xslt/dom.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/ajax/dwr.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/fileupload-cos/cos.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/plexus/classworlds.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/quickstart/commons-collections.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/bootstrap/commons-cli.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/jfree/jfreechart.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/build/mockobjects-jdk1.3-j2ee1.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/spring/commons-logging.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/jasperreports/commons-beanutils.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/jasperreports/commons-digester.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/spring/commons-attributes-api.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/quickstart/servletapi.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/build/mockobjects-alt-jdk1.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/pico/picocontainer.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/hibernate/asm.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/tiles/commons-digester.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/quickstart/ant.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/spring/spring-web.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/default/oscore.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/quickstart/commons-el.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/quickstart/jasper-compiler.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/build/xdoclet-web-module.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/hibernate/cglib.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/bootstrap/commons-logging.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/hibernate/antlr.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/build/jmock.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/build/servletapi.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/pico/nanocontainer-nanowar.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/default/xwork.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/jasperreports/poi.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/velocity/velocity-dep.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/portlet/portlet-api.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/jasperreports/commons-collections.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/spring/spring-context.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/quickstart/jasper-runtime.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/fileupload/commons-fileupload.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/hibernate/commons-collections.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/quickstart/commons-io.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/fileupload-pell/multipartrequest.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/default/rife-continuations.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/source/xwork-src.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/default/ognl.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/spring/spring-beans.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/tiger/xwork-tiger.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/velocity/velocity-tools-view.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/build/mockobjects-alt-jdk1.3-j2ee1.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/quickstart/commons-lang.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/hibernate/dom4j.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/cewolf/cewolf.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/build/jmock-cglib.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/build/clover.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/default/javamail.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/quickstart/log4j.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/plexus/plexus-utils.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/spring/cglib-nodep.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/pico/picocontainer-gems.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/build/junit.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/spring/spring-aop.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/quickstart/org.mortbay.jetty.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/build/xdoclet.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/build/xjavadoc.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/xslt/jcommon.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/quickstart/jsp-api.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/jfree/jcommon.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library" exported="">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/tiles/tiles-core.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/spring/spring-mock.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/build/easymock.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntry type="module-library">
|
||||
<library>
|
||||
<CLASSES>
|
||||
<root url="jar://$MODULE_DIR$/lib/build/easymockclassextension.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</orderEntry>
|
||||
<orderEntryProperties />
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="ACTIVE_VCS_NAME" value="CVS" />
|
||||
<option name="USE_PROJECT_VCS" value="false" />
|
||||
</component>
|
||||
<component name="org.mevenide.idea.module.ModuleSettings">
|
||||
<favoriteGoals>
|
||||
<list size="0" />
|
||||
</favoriteGoals>
|
||||
</component>
|
||||
</module>
|
||||
|
||||
+285
@@ -0,0 +1,285 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4" relativePaths="true">
|
||||
<component name="AntConfiguration">
|
||||
<defaultAnt bundledAnt="true" />
|
||||
<buildFile url="file://$PROJECT_DIR$/build.xml">
|
||||
<additionalClassPath>
|
||||
<entry path="file://$PROJECT_DIR$/lib/bootstrap/clover-license.jar" />
|
||||
<entry path="file://$PROJECT_DIR$/lib/build/junit.jar" />
|
||||
<entry path="file://$PROJECT_DIR$/lib/build/clover.jar" />
|
||||
</additionalClassPath>
|
||||
<antReference projectDefault="true" />
|
||||
<customJdkName value="" />
|
||||
<maximumHeapSize value="128" />
|
||||
<properties />
|
||||
</buildFile>
|
||||
<buildFile url="file://$PROJECT_DIR$/../xwork/build.xml">
|
||||
<additionalClassPath>
|
||||
<entry path="file://$PROJECT_DIR$/../xwork/lib/build/clover.jar" />
|
||||
<entry path="file://$PROJECT_DIR$/../xwork/lib/build/junit.jar" />
|
||||
<entry path="file://$PROJECT_DIR$/../xwork/lib/bootstrap/clover-license.jar" />
|
||||
</additionalClassPath>
|
||||
<antReference projectDefault="true" />
|
||||
<customJdkName value="1.5" />
|
||||
<maximumHeapSize value="128" />
|
||||
<properties />
|
||||
</buildFile>
|
||||
</component>
|
||||
<component name="CodeStyleSettingsManager">
|
||||
<option name="PER_PROJECT_SETTINGS">
|
||||
<value>
|
||||
<option name="WRAP_COMMENTS" value="true" />
|
||||
<option name="JD_P_AT_EMPTY_LINES" value="false" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
||||
</component>
|
||||
<component name="CompilerConfiguration">
|
||||
<option name="DEFAULT_COMPILER" value="Javac" />
|
||||
<option name="CLEAR_OUTPUT_DIRECTORY" value="true" />
|
||||
<option name="DEPLOY_AFTER_MAKE" value="2" />
|
||||
<resourceExtensions>
|
||||
<entry name=".+\.(properties|xml|html|dtd|tld|txt|vm)" />
|
||||
<entry name=".+\.(gif|png|jpeg|jpg)" />
|
||||
</resourceExtensions>
|
||||
<wildcardResourcePatterns>
|
||||
<entry name="?*.properties" />
|
||||
<entry name="?*.xml" />
|
||||
<entry name="?*.html" />
|
||||
<entry name="?*.dtd" />
|
||||
<entry name="?*.tld" />
|
||||
<entry name="?*.txt" />
|
||||
<entry name="?*.vm" />
|
||||
<entry name="?*.gif" />
|
||||
<entry name="?*.png" />
|
||||
<entry name="?*.jpeg" />
|
||||
<entry name="?*.jpg" />
|
||||
<entry name="?*.js" />
|
||||
<entry name="*.ftl" />
|
||||
<entry name="*.css" />
|
||||
</wildcardResourcePatterns>
|
||||
</component>
|
||||
<component name="DataSourceManager" />
|
||||
<component name="DataSourceManagerImpl" />
|
||||
<component name="DependenciesAnalyzeManager">
|
||||
<option name="myForwardDirection" value="false" />
|
||||
</component>
|
||||
<component name="DependencyValidationManager" />
|
||||
<component name="EntryPointsManager">
|
||||
<entry_points />
|
||||
</component>
|
||||
<component name="ExportToHTMLSettings">
|
||||
<option name="PRINT_LINE_NUMBERS" value="false" />
|
||||
<option name="OPEN_IN_BROWSER" value="false" />
|
||||
<option name="OUTPUT_DIRECTORY" />
|
||||
</component>
|
||||
<component name="GUI Designer component loader factory" />
|
||||
<component name="ImportConfiguration">
|
||||
<option name="VENDOR" />
|
||||
<option name="RELEASE_TAG" />
|
||||
<option name="LOG_MESSAGE" />
|
||||
<option name="CHECKOUT_AFTER_IMPORT" value="true" />
|
||||
</component>
|
||||
<component name="J2EEManager" />
|
||||
<component name="JavacSettings">
|
||||
<option name="DEBUGGING_INFO" value="true" />
|
||||
<option name="GENERATE_NO_WARNINGS" value="false" />
|
||||
<option name="DEPRECATION" value="true" />
|
||||
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
|
||||
<option name="MAXIMUM_HEAP_SIZE" value="128" />
|
||||
</component>
|
||||
<component name="JavadocGenerationManager">
|
||||
<option name="OUTPUT_DIRECTORY" />
|
||||
<option name="OPTION_SCOPE" value="protected" />
|
||||
<option name="OPTION_HIERARCHY" value="true" />
|
||||
<option name="OPTION_NAVIGATOR" value="true" />
|
||||
<option name="OPTION_INDEX" value="true" />
|
||||
<option name="OPTION_SEPARATE_INDEX" value="true" />
|
||||
<option name="OPTION_DOCUMENT_TAG_USE" value="false" />
|
||||
<option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
|
||||
<option name="OPTION_DOCUMENT_TAG_VERSION" value="false" />
|
||||
<option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
|
||||
<option name="OPTION_DEPRECATED_LIST" value="true" />
|
||||
<option name="OTHER_OPTIONS" value="" />
|
||||
<option name="HEAP_SIZE" />
|
||||
<option name="OPEN_IN_BROWSER" value="true" />
|
||||
</component>
|
||||
<component name="JikesSettings">
|
||||
<option name="JIKES_PATH" value="C:/spoke/bin/jikes.exe" />
|
||||
<option name="DEBUGGING_INFO" value="true" />
|
||||
<option name="DEPRECATION" value="true" />
|
||||
<option name="GENERATE_NO_WARNINGS" value="false" />
|
||||
<option name="IS_EMACS_ERRORS_MODE" value="true" />
|
||||
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
|
||||
</component>
|
||||
<component name="PEExternalization">
|
||||
<option name="IGNORE_METHOD_NAMES" value="" />
|
||||
<option name="IGNORE_METHOD_NAMES_ENABLED" value="false" />
|
||||
<option name="IGNORE_CLASS_CONSTRUCTORS">
|
||||
<value>
|
||||
<option class="Exception" includeInheritors="true" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="IGNORE_CLASS_CONSTRUCTOR_NAMES_ENABLED" value="true" />
|
||||
<option name="IGNORE_CLASS_METHODS_ENABLED" value="true" />
|
||||
<option name="IGNORE_STRINGS_CONTAINS_ONLY_ENABLED" value="true" />
|
||||
<option name="IGNORE_STRINGS_CONTAINS_ONLY_WHITESPACES" value="true" />
|
||||
<option name="IGNORE_STRINGS_CONTAINS_ONLY_PUNCTUATIONS" value="true" />
|
||||
<option name="IGNORE_STRINGS_CONTAINS_ONLY_SPECIFIED_ENABLED" value="true" />
|
||||
<option name="IGNORE_STRINGS_CONTAINS_ONLY_SPECIFIED" value="" />
|
||||
<option name="IGNORE_CLASS_METHODS">
|
||||
<value>
|
||||
<option class="Exception" includeInheritors="false" />
|
||||
<option class="java.util.ResourceBundle" includeInheritors="true" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="IGNORE_CONSTANTS_DECLARATIONS" value="true" />
|
||||
</component>
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/webapps/portlet/Portlet.iml" filepath="$PROJECT_DIR$/webapps/portlet/Portlet.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/webapps/shopping-cart/ShoppingCart.iml" filepath="$PROJECT_DIR$/webapps/shopping-cart/ShoppingCart.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/webapps/showcase/Showcase.iml" filepath="$PROJECT_DIR$/webapps/showcase/Showcase.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/webapps/starter/Starter.iml" filepath="$PROJECT_DIR$/webapps/starter/Starter.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/WebWork.iml" filepath="$PROJECT_DIR$/WebWork.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/../xwork/XWork.iml" filepath="$xwork$/XWork.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="false" project-jdk-name="1.4" />
|
||||
<component name="Regex">
|
||||
<option name="pos1" value="218" />
|
||||
<option name="pos2" value="218" />
|
||||
<option name="pos3" value="263" />
|
||||
<option name="pos4" value="444" />
|
||||
<option name="pos5" value="263" />
|
||||
<option name="pos6" value="1092" />
|
||||
</component>
|
||||
<component name="RmicSettings">
|
||||
<option name="IS_EANABLED" value="false" />
|
||||
<option name="DEBUGGING_INFO" value="true" />
|
||||
<option name="GENERATE_NO_WARNINGS" value="false" />
|
||||
<option name="GENERATE_IIOP_STUBS" value="false" />
|
||||
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
|
||||
</component>
|
||||
<component name="UI designer component loader factory" />
|
||||
<component name="WebManager">
|
||||
<option enabled="true" />
|
||||
</component>
|
||||
<component name="WebRootContainer">
|
||||
<root url="file://$PROJECT_DIR$/src/webapp" name="example" validate="false" />
|
||||
</component>
|
||||
<component name="libraryTable" />
|
||||
<component name="org.tmatesoft.tmate.projectComponent" />
|
||||
<component name="uidesigner-configuration">
|
||||
<option name="INSTRUMENT_CLASSES" value="true" />
|
||||
<option name="COPY_FORMS_RUNTIME_TO_OUTPUT" value="true" />
|
||||
</component>
|
||||
<UsedPathMacros>
|
||||
<macro name="xwork" />
|
||||
</UsedPathMacros>
|
||||
</project>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
name = webwork
|
||||
fullname = WebWork
|
||||
version = 2.3
|
||||
status = integration
|
||||
cvs.tag = webwork_2-3
|
||||
@@ -0,0 +1,217 @@
|
||||
<project name="webwork" default="jar" basedir=".">
|
||||
<!-- overridden properties (must be before the import!) -->
|
||||
<property name="src.test" value="src/test"/>
|
||||
<property name="src.xdt" value="src/xdt"/>
|
||||
<property name="compile.version" value="1.4"/>
|
||||
<property name="test.compile.version" value="1.4"/>
|
||||
|
||||
<import file="osbuild.xml"/>
|
||||
|
||||
<!-- overriding the one found in osbuild.xml to exclude xwork-tiger,
|
||||
which breaks the unit tests currently -->
|
||||
<path id="cp">
|
||||
<fileset dir="lib">
|
||||
<include name="**/*.jar"/>
|
||||
<include name="**/*.zip"/>
|
||||
<exclude name="**/jalopy/**"/>
|
||||
<exclude name="**/tiger/**"/>
|
||||
</fileset>
|
||||
</path>
|
||||
|
||||
<mkdir dir="${build}/xwork-src"/>
|
||||
<path id="javadoc.path">
|
||||
<path path="${src.java}"/>
|
||||
<path path="${build}/xwork-src"/>
|
||||
</path>
|
||||
|
||||
<property name="build.tagdocs" value="${build}/tagdocs"/>
|
||||
<property name="docs.tags" value="${docs}/tags"/>
|
||||
|
||||
<target name="init" depends="common.init" unless="skip.ivy">
|
||||
<taskdef name="ivy-configure" classname="fr.jayasoft.ivy.ant.IvyConfigure" classpathref="cp"/>
|
||||
<taskdef name="ivy-resolve" classname="fr.jayasoft.ivy.ant.IvyResolve" classpathref="cp"/>
|
||||
<taskdef name="ivy-retrieve" classname="fr.jayasoft.ivy.ant.IvyRetrieve" classpathref="cp"/>
|
||||
<taskdef name="ivy-publish" classname="fr.jayasoft.ivy.ant.IvyPublish" classpathref="cp"/>
|
||||
<taskdef name="ivy-report" classname="fr.jayasoft.ivy.ant.IvyReport" classpathref="cp"/>
|
||||
<taskdef name="ivy-deliver" classname="fr.jayasoft.ivy.ant.IvyDeliver" classpathref="cp"/>
|
||||
|
||||
<ivy-retrieve/>
|
||||
</target>
|
||||
|
||||
<target name="javadocs" depends="common.init">
|
||||
<!-- first, unzip the xwork-src jar so we can generate unified javadocs -->
|
||||
<unjar src="${lib}/source/xwork-src.jar" dest="${build}/xwork-src"/>
|
||||
<antcall target="common.javadocs"/>
|
||||
</target>
|
||||
|
||||
<target name="ivyrep.copy-ivy" depends="init">
|
||||
<ivy-deliver deliverpattern="${ivyrep.path}/opensymphony/${name}/[artifact]-[revision].[ext]"
|
||||
pubrevision="${version}-${TIME}" pubdate="${TIME}"/>
|
||||
</target>
|
||||
|
||||
<target name="reports" depends="common.reports">
|
||||
<mkdir dir="${dist.docs}/dependencies"/>
|
||||
<!--
|
||||
<ivy-report todir="${dist.docs}/dependencies" graph="false"/>
|
||||
-->
|
||||
</target>
|
||||
|
||||
<macrodef name="webapp">
|
||||
<attribute name="name"/>
|
||||
<sequential>
|
||||
<mkdir dir="${dist}/webapps/@{name}/src"/>
|
||||
<copy todir="${dist}/webapps/@{name}/src">
|
||||
<fileset dir="webapps/@{name}/src" includes="**/**"/>
|
||||
</copy>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<target name="predist">
|
||||
<!-- grab the README.txt file -->
|
||||
<copy file="${src}/etc/README.txt" todir="${dist}"/>
|
||||
|
||||
<mkdir dir="${dist}/dist" />
|
||||
<move file="${build}/${name}-nostatic-${version}.jar" todir="${dist}/dist" />
|
||||
<move file="${build}/${name}-static-${version}.zip" todir="${dist}/dist" />
|
||||
|
||||
<!-- prepare the template project -->
|
||||
<webapp name="blank"/>
|
||||
<copy todir="${dist}/webapps/blank">
|
||||
<fileset dir="webapps/blank/" includes="*.iml" />
|
||||
</copy>
|
||||
|
||||
<!-- prepare each tutorial/example -->
|
||||
<webapp name="starter"/>
|
||||
<webapp name="showcase"/>
|
||||
<webapp name="shopping-cart"/>
|
||||
<webapp name="portlet"/>
|
||||
|
||||
<!-- copy over elements required to build the final wars -->
|
||||
<copy file="webapps/build.xml" todir="${dist}/webapps"/>
|
||||
</target>
|
||||
|
||||
<target name="xdoclet-taglib" depends="init">
|
||||
<taskdef
|
||||
name="xdoclet"
|
||||
classname="xdoclet.DocletTask"
|
||||
classpathref="cp"
|
||||
/>
|
||||
<xdoclet destdir="src/java/META-INF"
|
||||
excludedtags="@version,@author,@return,@exception,@todo"
|
||||
verbose="false"
|
||||
force="true"
|
||||
>
|
||||
<!--
|
||||
mergedir="src/etc"
|
||||
-->
|
||||
<fileset dir="${src.java}">
|
||||
<include name="com/opensymphony/webwork/views/**/*.java"/>
|
||||
<include name="com/opensymphony/webwork/components/**/*.java"/>
|
||||
</fileset>
|
||||
<configParam name="Jspversion" value="1.2"/>
|
||||
<configParam name="Taglibversion" value="${version}"/>
|
||||
<configParam name="Description" value="WebWork JSP Taglib"/>
|
||||
<configParam name="Shortname" value="WebWork Taglib"/>
|
||||
<configParam name="Displayname" value="WebWork Taglib"/>
|
||||
<configParam name="Smallicon" value=""/>
|
||||
<configParam name="Largeicon" value=""/>
|
||||
<configParam name="Uri" value="/webwork"/>
|
||||
<xmlTemplate templateFile="${src.xdt}/taglib_tld.xdt" destinationfile="taglib.tld"/>
|
||||
</xdoclet>
|
||||
</target>
|
||||
|
||||
<target name="xdoclet-tagdoc" depends="init">
|
||||
<mkdir dir="${build.tagdocs}"/>
|
||||
<taskdef name="xdoclet" classname="xdoclet.DocletTask" classpathref="cp"/>
|
||||
<xdoclet destdir="${build.tagdocs}"
|
||||
excludedtags="@version,@author,@return,@exception"
|
||||
verbose="false"
|
||||
force="true"
|
||||
>
|
||||
<fileset dir="${src.java}">
|
||||
<include name="com/opensymphony/webwork/views/**/*.java"/>
|
||||
<include name="com/opensymphony/webwork/components/**/*.java"/>
|
||||
</fileset>
|
||||
<xmlTemplate templateFile="${src.xdt}/tagdoc.xdt" destinationfile="{0}.html"/>
|
||||
</xdoclet>
|
||||
<xdoclet destdir="${build.tagdocs}"
|
||||
excludedtags="@version,@author,@return,@exception"
|
||||
verbose="false"
|
||||
force="true"
|
||||
>
|
||||
<fileset dir="${src.java}">
|
||||
<include name="com/opensymphony/webwork/views/**/*.java"/>
|
||||
<include name="com/opensymphony/webwork/components/**/*.java"/>
|
||||
</fileset>
|
||||
<configParam name="Taglibversion" value="${version}"/>
|
||||
<template templateFile="${src.xdt}/tagdoc-toc.xdt" destinationfile="index.html"/>
|
||||
</xdoclet>
|
||||
|
||||
<mkdir dir="${docs.tags}"/>
|
||||
<copy todir="${docs.tags}" flatten="true" includeemptydirs="false">
|
||||
<fileset dir="${build.tagdocs}" includes="**/*.html">
|
||||
<size value="10" when="more"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="mavenrep" depends="jar">
|
||||
<!-- webwork -->
|
||||
<copy file="pom.xml" tofile="/opt/repository/ibiblio.org/opensymphony/poms/${name}-${version}-SNAPSHOT.pom"/>
|
||||
<copy file="${build}/${name}-${version}.jar" tofile="/opt/repository/ibiblio.org/opensymphony/jars/${name}-${version}-SNAPSHOT.jar"/>
|
||||
<copy file="${build}/${name}-src-${version}.jar" tofile="/opt/repository/ibiblio.org/opensymphony/jars/${name}-src-${version}-SNAPSHOT.jar"/>
|
||||
</target>
|
||||
|
||||
<!-- overridden targets -->
|
||||
<target name="jar" depends="compile">
|
||||
<mkdir dir="${build}"/>
|
||||
|
||||
<jar basedir="${build.java}" jarfile="${build}/${name}-${version}.jar">
|
||||
<manifest>
|
||||
<attribute name="Main-Class" value="com.opensymphony.webwork.Main"/>
|
||||
<attribute name="Implementation-Title" value="${fullname}"/>
|
||||
<attribute name="Implementation-Version" value="${version}"/>
|
||||
</manifest>
|
||||
</jar>
|
||||
<jar basedir="${src.java}" jarfile="${build}/${name}-src-${version}.jar">
|
||||
<zipgroupfileset file="lib/source/xwork-src.jar"/>
|
||||
<manifest>
|
||||
<attribute name="Implementation-Title" value="${fullname}"/>
|
||||
<attribute name="Implementation-Version" value="${version}"/>
|
||||
</manifest>
|
||||
</jar>
|
||||
<jar jarfile="${build}/${name}-nostatic-${version}.jar">
|
||||
<fileset dir="${build.java}">
|
||||
<exclude name="com/opensymphony/webwork/static/**/*" />
|
||||
</fileset>
|
||||
<manifest>
|
||||
<attribute name="Main-Class" value="com.opensymphony.webwork.Main"/>
|
||||
<attribute name="Implementation-Title" value="${fullname}"/>
|
||||
<attribute name="Implementation-Version" value="${version}"/>
|
||||
</manifest>
|
||||
</jar>
|
||||
<zip destfile="${build}/${name}-static-${version}.zip">
|
||||
<zipfileset dir="${build.java}/com/opensymphony/webwork/static" prefix="webwork" />
|
||||
</zip>
|
||||
</target>
|
||||
|
||||
<target name="dist" depends="common.dist" description="generate distribution zip file">
|
||||
<propertyfile file="${dist}/build.properties">
|
||||
<entry key="skip.ivy" value="true"/>
|
||||
</propertyfile>
|
||||
</target>
|
||||
|
||||
<target name="clean" depends="common.clean">
|
||||
<delete dir="webapps/base/build"/>
|
||||
<delete dir="webapps/blank/build"/>
|
||||
<delete dir="webapps/showcase/build"/>
|
||||
<delete dir="webapps/starter/build"/>
|
||||
<delete dir="webapps/ajax/build"/>
|
||||
<delete dir="webapps/shopping-cart/build"/>
|
||||
<delete dir="webapps/portlet/build"/>
|
||||
<!--
|
||||
<delete dir="webapps/wwia/build"/>
|
||||
-->
|
||||
</target>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1 @@
|
||||
D
|
||||
@@ -0,0 +1 @@
|
||||
webwork/docs/Chaining Interceptor_attachments
|
||||
@@ -0,0 +1 @@
|
||||
:pserver:mrdon@cvs.dev.java.net:/cvs
|
||||
@@ -0,0 +1,19 @@
|
||||
Issue number:
|
||||
Obtained from:
|
||||
Submitted by:
|
||||
Reviewed by:
|
||||
CVS: ----------------------------------------------------------------------
|
||||
CVS: Issue number:
|
||||
CVS: If this change addresses one or more issues,
|
||||
CVS: then enter the issue number(s) here.
|
||||
CVS: Obtained from:
|
||||
CVS: If this change has been taken from another system,
|
||||
CVS: then name the system in this line, otherwise delete it.
|
||||
CVS: Submitted by:
|
||||
CVS: If this code has been contributed to the project by someone else; i.e.,
|
||||
CVS: they sent us a patch or a set of diffs, then include their name/email
|
||||
CVS: address here. If this is your work then delete this line.
|
||||
CVS: Reviewed by:
|
||||
CVS: If we are doing pre-commit code reviews and someone else has
|
||||
CVS: reviewed your changes, include their name(s) here.
|
||||
CVS: If you have not had it reviewed then delete this line.
|
||||
@@ -0,0 +1,28 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork</title>
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<center><img src="logo.png" /></center>
|
||||
|
||||
<i>注: 如果您需要查看WebWork 1.0的有关信息,请访问<a href="http://www.opensymphony.com/webwork_old">http://www.opensymphony.com/webwork_old</a></i>
|
||||
|
||||
<p/>
|
||||
|
||||
WebWork是一个Java web-application开发框架(development framework). 它专注于提高开发者的生产效率并简化代码. WebWork构建在XWork之上, XWork提供了普通的(generic)命令模式(command pattern)框架, 同时也是一个反转控制(Inversion of Control, IoC)容器. 除了上述特性外, WebWork还为其它功能如创建可复用的用户界面模版(UI template), 表单(form)控制, 用户界面主题(UI theme), 国际化, 表单参数与JavaBean的动态映射, 健壮的客户端及服务器端校验(validation)提供了强有力的支持.
|
||||
|
||||
<p/>
|
||||
|
||||
您可以从下面的地址中找到并下载WebWork最新版本的文档. 当前开发版本的文档总可以在WebWork wiki上找到. 如果您对本文档有修改或修正意见的话, 可以直接在wiki上进行修改.
|
||||
|
||||
<p/>
|
||||
|
||||
<ul>
|
||||
<li><a href="wikidocs/Documentation.html">文档</a> (<a href="wikidocs/docs.pdf">PDF版本</a>)</li>
|
||||
<li><a href="http://wiki.opensymphony.com/display/WW">Wiki</a></li>
|
||||
</ul>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
@@ -0,0 +1,14 @@
|
||||
<p>
|
||||
<h3>WebWork</h3>
|
||||
<a href="/webwork">Home</a><br/>
|
||||
<a href="@DOWNLOAD@">Download</a> (<a href="@DOWNLOAD_JAR@">JAR</a>)<br>
|
||||
<a href="/webwork/wikidocs/Documentation.html">Documentation</a> (<a href="/webwork/wikidocs/docs.pdf">PDF</a>)<br>
|
||||
<a href="/webwork/api/">API Documentation</a><br>
|
||||
</p>
|
||||
<h3>Services</h3>
|
||||
<b>JIRA</b><br>
|
||||
- <a href="http://jira.opensymphony.com/secure/BrowseProject.jspa?id=10030">Issue Overview</a><br>
|
||||
- <a href="http://jira.opensymphony.com/secure/BrowseProject.jspa?id=10030&report=roadmap">Roadmap</a><br>
|
||||
- <a href="http://jira.opensymphony.com/secure/BrowseProject.jspa?id=10030&report=changelog">Changelog</a><br>
|
||||
<b>Wiki</b><br>
|
||||
- <a href="http://wiki.opensymphony.com/display/WW">WebWork page</a>
|
||||
@@ -0,0 +1,14 @@
|
||||
<p>
|
||||
<h3>WebWork</h3>
|
||||
<a href="/webwork">Home</a><br/>
|
||||
<a href="https://webwork.dev.java.net/files/documents/693/8838/webwork-2.1.6.zip">Download</a> (<a href="https://webwork.dev.java.net/files/documents/693/8839/webwork-2.1.6.jar">JAR</a>)<br>
|
||||
<a href="/webwork/wikidocs/Documentation.html">Documentation</a> (<a href="/webwork/wikidocs/docs.pdf">PDF</a>)<br>
|
||||
<a href="/webwork/api/">API Documentation</a><br>
|
||||
</p>
|
||||
<h3>Services</h3>
|
||||
<b>JIRA</b><br>
|
||||
- <a href="http://jira.opensymphony.com/secure/BrowseProject.jspa?id=10030">Issue Overview</a><br>
|
||||
- <a href="http://jira.opensymphony.com/secure/BrowseProject.jspa?id=10030&report=roadmap">Roadmap</a><br>
|
||||
- <a href="http://jira.opensymphony.com/secure/BrowseProject.jspa?id=10030&report=changelog">Changelog</a><br>
|
||||
<b>Wiki</b><br>
|
||||
- <a href="http://wiki.opensymphony.com/display/WW">WebWork page</a>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@@ -0,0 +1,53 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Accessing application, session, request objects</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Accessing application, session, request objects
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 30, 2004 by <font color="#0050B2">jcarreira</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">Webwork provides several access helpers to access Session, Application, Request scopes.<br/>
|
||||
Web agnostic (independent of the servlet API) with calls:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>Map session = (Map) ActionContext.getContext().get(<span class="java-quote">"session"</span>); session.put(<span class="java-quote">"myId"</span>,myProp);</pre>
|
||||
</div></div></p>The following gives you the same thing as above:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>ServletActionContext.getRequest().getSession()</pre>
|
||||
</div></div><p class="paragraph">Note: Be sure not to use ActionContext.getContext() in the constructor of your action since the values may not be set up already (returning null for getSession()).<br/>
|
||||
Note also: ActionContext.getContext().get("session") is the same as<br/>
|
||||
ActionContext.getContext().getSession() with a cast to Map.</p>If you really need to get access to the HttpSession, use the ServletConfigInterceptor (see <a href="Interceptors.html" title="Interceptors">Interceptors</a>).<p class="paragraph">In your views, you can access with your jsps as such
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww: property value=<span class="java-quote">"#session.myId"</span> /> <ww: property value=<span class="java-quote">"#request.myId"</span> /></pre>
|
||||
</div></div></p>All the servlet scopes can be accessed like above.
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>Map request = (Map) ActionContext.getContext().get(<span class="java-quote">"request"</span>); request.put(<span class="java-quote">"myId"</span>,myProp); Map application = (Map) ActionContext.getContext().get(<span class="java-quote">"application"</span>); application.put(<span class="java-quote">"myId"</span>,myProp); Map session = (Map) ActionContext.getContext().get(<span class="java-quote">"attr"</span>); attr.put(<span class="java-quote">"myId"</span>,myProp);</pre>
|
||||
</div></div><br/>
|
||||
The 'attr' map will search the javax.servlet.jsp.PageContext for the specified key. If the PageContext dosen't exist, it will search request,session,application maps respectively.
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,53 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Action Chaining Result</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Action Chaining Result
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 13, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h4 style="margin: 4px 0px 4px 0px;" class="heading4"><a name="ActionChainingResult-ActionChaining"> 活动链</a></h4>
|
||||
视图的一种, 它调用GenericDispatch(使用前面已存在的ActionContext)执行其他活动. 如果你需要在一个活动后执行另一个活动, 这一类型十分有用.</p><table class="wikitable">
|
||||
<tr>
|
||||
<th>参数 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> actionName </td><td> <b class="strong">是</b> </td><td> 要链接的活动名</td>
|
||||
</tr><tr>
|
||||
<td> namespace </td><td> 否 </td><td> 设置链接活动的名空间. 如果名空间为空, 使用当前名空间[<i>或缺省名空间""</i>]. </td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"chain"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"actionName"</span>></span>bar<span class="xml-tag"></param></span> <span class="xml-tag"><param name=<span class="xml-quote">"namespace"</span>></span>/foo<span class="xml-tag"></param></span> <span class="xml-tag"></result></span></pre>
|
||||
</div></div><br/>
|
||||
调用活动
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><action name=<span class="xml-quote">"bar"</span> class=<span class="xml-quote">"myPackage.barAction"</span>></span> ... <span class="xml-tag"></action></span></pre>
|
||||
</div></div>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 活动链</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 活动链
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 29, 2004 by <font color="#0050B2">jcarreira</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">WebWork2中的ActionChainResult可以将多个活动组合起来按照定义号的顺序或工作流程执行. 使用ActionChainResult作为活动的结果类型, 如下:</p><div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><!-- simple chain example to an action in same namespace -></span> <span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"chain"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"actionName"</span>></span>Bar<span class="xml-tag"></param></span> <span class="xml-tag"></result></span></pre>
|
||||
</div></div>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><!- example of chaining to an action in a different namespace/package --></span> <span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"chain"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"actionName"</span>></span>viewFoo<span class="xml-tag"></param></span> <span class="xml-tag"><param name=<span class="xml-quote">"namespace"</span>></span>/foo<span class="xml-tag"></param></span> <span class="xml-tag"></result></span></pre>
|
||||
</div></div><p class="paragraph">同一个名空间(或缺省名空间"")中的另一个活动将在该活动后执行(参见<a href="http://wiki.opensymphony.com//display/XW/Configuration" title="Configuration">XW:Configuration</a>). 页可以使用可选的"namespace"参数指定不同名空间中的活动. Request中的原始(original)参数和ValueStack被传递到链上, 同时被链接的活动也被传递到值栈中. 这就允许链接的活动可以在值栈中访问之前活动的属性, 这些属性页可以在链的最后结果(如JSP或Velocity页面)中使用.</p>如果需要将前一个活动的属性复制到当前活动中, 可以使用ChainingInterceptor(参见<a href="http://wiki.opensymphony.com//display/XW/Interceptors" title="Interceptors">XW:Interceptors</a>), 它会将值栈中所有对象的属性全部复制到当前目标对象中.<p class="paragraph">活动链的一般用途是提供查找表(例如关于状态的下拉列表). 由于活动被放置在值栈中, 因此它们的属性页可以在视图中使用. 也可以通过在先是页面中使用action标签执行一个活动来完成这一目的. 在WebWork 1.x中活动链通常链接到RedirectAction以便在处理后重定向到另一个页面(WebWork2 提供了redirect结果类型).</p>当你向要封装一些复用代码时, 这一方法很有用… 在WebWork 2中, 如果某个复用代码被大量使用, 可以把它编写为截取器, 或者使用活动链. 如果你需要设置并使用某些属性, 应该使用活动.
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,45 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 应用服务器</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 应用服务器
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 20, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<ul class="star">
|
||||
<li> <a href="WebLogic.html" title="WebLogic">WebLogic</a>[<i>这里介绍的是WebLogic5.1版本</i>]</li>
|
||||
<li> WebSphere</li>
|
||||
<li> JRun</li>
|
||||
<li> Jetty</li>
|
||||
<li> Tomcat/JBoss</li>
|
||||
<li> Resin</li>
|
||||
<li> Orion</li>
|
||||
<li> OC4J</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Application, Session, Request objects in jsp</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Application, Session, Request objects in jsp
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 30, 2004 by <font color="#0050B2">jcarreira</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">The application, session and request objects are available from within ww tags in jsp wherever ognl can be evaluated. Use the #session syntax to get the object and access values by their keys using ['key'].<div class="code"><div class="codeContent">
|
||||
<pre><ww:property value=<span class="java-quote">"#application['foo']"</span>/> <ww:property value=<span class="java-quote">"#session['baz']"</span>/></pre>
|
||||
</div></div><br/>
|
||||
Conversely, if you would like to make webwork objects availible to say the jsp/jstl request scope. The property tag can be used like this.</p><div class="code"><div class="codeContent">
|
||||
<pre><ww:set name=<span class="java-quote">"jobz"</span> value=<span class="java-quote">"jobs"</span> scope=<span class="java-quote">"request"</span> /></pre>
|
||||
</div></div><p class="paragraph">A full example below shows a webwork variable "jobs" being exposed as "jobz" and being used with jstl and the display tag.</p><a href="Exposing webwork objects to JSTL, with a JSTL and DisplayTag Example.html" title="Exposing webwork objects to JSTL, with a JSTL and DisplayTag Example">WW:Exposing webwork objects to JSTL, with a JSTL and DisplayTag Example</a>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,45 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Application, Session, Request objects in vm</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Application, Session, Request objects in vm
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 30, 2004 by <font color="#0050B2">jcarreira</font>.
|
||||
</div>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>$req.session.servletContext.getAttribute(...) $req.session.getAttribute(...) $req.getAttribute(...)</pre>
|
||||
</div></div>
|
||||
<p class="paragraph">To get parameters from the QueryString or from a POSTed form, do not use getAttribute, use:</p><div class="code"><div class="codeContent">
|
||||
<pre>$req.getParameter(...)</pre>
|
||||
</div></div><p class="paragraph">But that's quite obvious, since $req is the request object and we all know how it works.</p><b class="strong">Example:</b><p class="paragraph">_<em class="emphasis">test.jsp</em>_:</p><div class="code"><div class="codeContent">
|
||||
<pre><html><head></head><body> <% session.setAttribute(<span class="java-quote">"sessionFoo"</span>, <span class="java-quote">"sessionBar"</span>); session.getServletContext().setAttribute(<span class="java-quote">"applicationFoo"</span>, <span class="java-quote">"applicationBar"</span>); %> <p>The following information should be available when sending the form below: <ul> <li>Request parameter 'querystringFoo' with value 'querystringBar';</li> <li>Request parameter 'formFoo' with value 'formBar';</li> <li>Session attribute 'sessionFoo' with value 'sessionBar';</li> <li>Application attribute 'applicationFoo' with value 'applicationBar'.</li> </ul> </p> <form action=<span class="java-quote">"test.vm?querystringFoo=querystringBar"</span> method=<span class="java-quote">"post"</span>> <input type=<span class="java-quote">"hidden"</span> name=<span class="java-quote">"formFoo"</span> value=<span class="java-quote">"formBar"</span>> <p><input type=<span class="java-quote">"submit"</span> value=<span class="java-quote">"Test!"</span>></p> </form> </body></html></pre>
|
||||
</div></div><p class="paragraph">_<em class="emphasis">test.vm</em>_:</p><div class="code"><div class="codeContent">
|
||||
<pre><html><head></head><body> #set ($ses = $req.getSession()) #set ($app = $ses.getServletContext()) <p>applicationFoo = $!app.getAttribute(<span class="java-quote">"applicationFoo"</span>) <code>(app.getAttribute(<span class="java-quote">"applicationFoo"</span>))</code></p> <p>sessionFoo = $!ses.getAttribute(<span class="java-quote">"sessionFoo"</span>) <code>(ses.getAttribute(<span class="java-quote">"sessionFoo"</span>))</code></p> <p>formFoo = $!req.getParameter(<span class="java-quote">"formFoo"</span>) <code>(req.getParameter(<span class="java-quote">"formFoo"</span>))</code></p> <p>querystringFoo = $!req.getParameter(<span class="java-quote">"querystringFoo"</span>) <code>(req.getParameter(<span class="java-quote">"queryStringFoo"</span>))</code></p> </body></html></pre>
|
||||
</div></div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,47 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Articles</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Articles
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on May 20, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<ul class="star">
|
||||
<li> Book: <a href="http://www.amazon.com/exec/obidos/tg/detail/-/0471463620/qid=1075480890/ref=sr_8_xs_ap_i2_xgl14/002-9701603-2786440?v=glance&s=books&n=507846" title="Visit page outside Confluence"> Java Open Source Programming : with XDoclet, JUnit, WebWork, Hibernate</a></li>
|
||||
<li> A good summary of what's new in WebWork 2.0: <a href="http://blogs.atlassian.com/rebelutionary/archives/000085.html" title="Visit page outside Confluence">http://blogs.atlassian.com/rebelutionary/archives/000085.html</a></li>
|
||||
<li> <a href="http://wiki.opensymphony.com//display/WW/Writeup+of+Mike%27s+Talk+at+TSS+on+WebWork2" title="Writeup of Mike's Talk at TSS on WebWork2">Writeup of Mike's Talk at TSS on WebWork2</a> (7/03)</li>
|
||||
<li> Mike's PPT Presentation from TSS Symposium: <a href="http://blogs.atlassian.com/rebelutionary/archives/000200.html" title="Visit page outside Confluence">http://blogs.atlassian.com/rebelutionary/archives/000200.html</a></li>
|
||||
<li> Some Japanese translated information (including the presentation above): <a href="http://www.mobster.jp/webwork/" title="Visit page outside Confluence">http://www.mobster.jp/webwork/</a></li>
|
||||
<li> Another PPT presentation from Rick Salsa, Groove Systems: <a href="http://www.groovesystems.com/training/java4/webwork.ppt" title="Visit page outside Confluence">http://www.groovesystems.com/training/java4/webwork.ppt</a></li>
|
||||
<li> Building with WebWork on TheServerSide (11/03): <a href="http://www.theserverside.com/resources/article.jsp?l=WebWork2" title="Visit page outside Confluence">http://www.theserverside.com/resources/article.jsp?l=WebWork2</a></li>
|
||||
<li> Jason Carreira's slides and example code (4/04): <a href="http://wiki.opensymphony.com/space/WebWork2/webwork-talk.zip" title="Visit page outside Confluence">webwork-talk.zip</a></li>
|
||||
<li> A brazilian portuguese tutorial teaching the main concepts and features of Webwork (14/04): <a href="http://www.guj.com.br/user.article.get.chain?page=1&article.id=135" title="Visit page outside Confluence">tutorial</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,36 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Bug跟踪和wiki</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Bug跟踪和wiki
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Oct 15, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">Webwork和Xwork的BUG跟踪系统(与所有Opensymphony项目一样)可以在<a href="http://jira.opensymphony.com" title="Visit page outside Confluence">http://jira.opensymphony.com</a>找到.</p>Webwork wiki大量本项目的知识包括范例代码, 食谱, 以及对框架一般性讨论的. Wiki可以在<a href="http://wiki.opensymphony.com/display/WW/WebWork" title="Visit page outside Confluence">http://wiki.opensymphony.com/display/WW/WebWork</a>找到.
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,3 @@
|
||||
/HibernateAction.java/1.1/Mon Mar 21 04:16:08 2005//
|
||||
/HibernateUtil.java/1.1/Mon Mar 21 04:16:09 2005//
|
||||
D
|
||||
@@ -0,0 +1 @@
|
||||
webwork/docs/chinese/wikidocs/Chaining Interceptor_attachments
|
||||
@@ -0,0 +1 @@
|
||||
:pserver:mrdon@cvs.dev.java.net:/cvs
|
||||
@@ -0,0 +1,19 @@
|
||||
Issue number:
|
||||
Obtained from:
|
||||
Submitted by:
|
||||
Reviewed by:
|
||||
CVS: ----------------------------------------------------------------------
|
||||
CVS: Issue number:
|
||||
CVS: If this change addresses one or more issues,
|
||||
CVS: then enter the issue number(s) here.
|
||||
CVS: Obtained from:
|
||||
CVS: If this change has been taken from another system,
|
||||
CVS: then name the system in this line, otherwise delete it.
|
||||
CVS: Submitted by:
|
||||
CVS: If this code has been contributed to the project by someone else; i.e.,
|
||||
CVS: they sent us a patch or a set of diffs, then include their name/email
|
||||
CVS: address here. If this is your work then delete this line.
|
||||
CVS: Reviewed by:
|
||||
CVS: If we are doing pre-commit code reviews and someone else has
|
||||
CVS: reviewed your changes, include their name(s) here.
|
||||
CVS: If you have not had it reviewed then delete this line.
|
||||
@@ -0,0 +1,47 @@
|
||||
package cash.action;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import com.opensymphony.xwork.ActionContext;
|
||||
import com.opensymphony.xwork.ActionSupport;
|
||||
|
||||
/**
|
||||
* Superclass for Hibernate-aware actions.
|
||||
*
|
||||
* @author Joel Hockey
|
||||
* @version $Id: HibernateAction.java,v 1.1 2005/03/21 04:16:08 plightbo Exp $
|
||||
*/
|
||||
public abstract class HibernateAction extends ActionSupport {
|
||||
/** xwork action return code */
|
||||
public static final String DBERROR = "dberror";
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(HibernateAction.class);
|
||||
|
||||
private boolean m_rollback = false;
|
||||
|
||||
/** roll back the current session */
|
||||
protected void setRollbackOnly() { m_rollback = true; }
|
||||
|
||||
/** @return whether the current Hibernate Session should be rolled back */
|
||||
public boolean getRollback() { return m_rollback; }
|
||||
|
||||
/**
|
||||
* Sets an object into the web session
|
||||
* @param key Key used to index object
|
||||
* @param object The object to store
|
||||
*/
|
||||
public void set(Object key, Object object) {
|
||||
ActionContext.getContext().getSession().put(key, object);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve object from web session
|
||||
* @param key Key used to index object
|
||||
* @return object if it exists, or null
|
||||
*/
|
||||
public Object get(Object key) {
|
||||
return ActionContext.getContext().getSession().get(key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package cash.util;
|
||||
|
||||
import net.sf.hibernate.HibernateException;
|
||||
import net.sf.hibernate.SessionFactory;
|
||||
import net.sf.hibernate.Session;
|
||||
import net.sf.hibernate.cfg.Configuration;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Helper Singleton class to manage Hibernate Sessions.
|
||||
*
|
||||
* @author Joel Hockey
|
||||
* @version $Id: HibernateUtil.java,v 1.1 2005/03/21 04:16:09 plightbo Exp $
|
||||
*/
|
||||
public class HibernateUtil {
|
||||
|
||||
/** ThreadLocal Session Map */
|
||||
public static final ThreadLocal MAP = new ThreadLocal();
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(HibernateUtil.class);
|
||||
|
||||
private static final SessionFactory SESSION_FACTORY;
|
||||
|
||||
/** Make default construct private */
|
||||
private HibernateUtil() { }
|
||||
|
||||
/** Loads Hibernate config. */
|
||||
static {
|
||||
try {
|
||||
LOG.debug("HibernateUtil.static - loading config");
|
||||
SESSION_FACTORY = new Configuration().configure().buildSessionFactory();
|
||||
LOG.debug("HibernateUtil.static - end");
|
||||
} catch (HibernateException ex) {
|
||||
throw new RuntimeException("Exception building SessionFactory: " + ex.getMessage(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Hibernate Session for current thread. When finished, users
|
||||
* must return session using {@link #closeSession() closeSession()} method.
|
||||
* @return Hibernate Session for current thread.
|
||||
* @throws HibernateException if there is an error opening a new session.
|
||||
*/
|
||||
public static Session currentSession() throws HibernateException {
|
||||
Session s = (Session)MAP.get();
|
||||
// Open a new Session, if this Thread has none yet
|
||||
if (s == null) {
|
||||
s = SESSION_FACTORY.openSession();
|
||||
MAP.set(s);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
/**
|
||||
* Closes the Hibernate Session. Users must call this method after calling
|
||||
* {@link #currentSession() currentSession()}.
|
||||
* @throws HibernateException if session has problem closing.
|
||||
*/
|
||||
public static void closeSession() throws HibernateException {
|
||||
Session s = (Session)MAP.get();
|
||||
MAP.set(null);
|
||||
if (s != null) {
|
||||
s.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Checkbox标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Checkbox标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="Checkboxtag-%26lt%3Bww%3Acheckbox%2F%26gt%3B"> <ww:checkbox /></a></h3></p>绘制一个类型为checkbox的HTML输入(input)元素, 并使用OgnlValueStack中的指定属性配置该元素. <p class="paragraph"><b class="strong">示例</b>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>JSP <span class="xml-tag"><ww:checkbox label=<span class="xml-quote">"'checkbox test'"</span> name=<span class="xml-quote">"'checkboxField1'"</span> value=<span class="xml-quote">"aBoolean"</span> fieldValue=<span class="xml-quote">"'true'"</span>/></span> Velocity #tag( Checkbox <span class="xml-quote">"label='checkbox test'"</span> <span class="xml-quote">"name='checkboxField1'"</span> value=<span class="xml-quote">"aBoolean"</span> fieldValue=<span class="xml-quote">"'true'"</span> ) HTML (simple template, aBoolean == true) <span class="xml-tag"><input type=<span class="xml-quote">"checkbox"</span> name=<span class="xml-quote">"checkboxField1"</span> value=<span class="xml-quote">"true"</span> checked=<span class="xml-quote">"checked"</span> /></span></pre>
|
||||
</div></div></p><b class="strong">属性</b>
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th> 名字 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> id </td><td> 否 </td><td> HTML的id属性 </td>
|
||||
</tr><tr>
|
||||
<td> name </td><td> <b class="strong">是</b> </td><td> HTML的name属性 </td>
|
||||
</tr><tr>
|
||||
<td> label </td><td> 否 </td><td> 用于模版中的标签文字 </td>
|
||||
</tr><tr>
|
||||
<td> labelposition </td><td> 否 </td><td> 标签的对齐方式 (left,right,center) </td>
|
||||
</tr><tr>
|
||||
<td> required </td><td> 否 </td><td> 在表单提交时是否是必需字段 </td>
|
||||
</tr><tr>
|
||||
<td> value </td><td> 否 </td><td> Boolean类型, 如果为true则添加'checked="checked"' </td>
|
||||
</tr><tr>
|
||||
<td> fieldValue </td><td> <b class="strong">是</b> </td><td> HTML中复选框的值 </td>
|
||||
</tr><tr>
|
||||
<td> tabindex </td><td> 否 </td><td> HTML的tabindex属性</td>
|
||||
</tr><tr>
|
||||
<td> onchange </td><td> 否 </td><td> HTML的onchange属性 </td>
|
||||
</tr><tr>
|
||||
<td> onclick </td><td> 否 </td><td> HTML的onclick属性 </td>
|
||||
</tr><tr>
|
||||
<td> cssClass </td><td> 否 </td><td> HTML的class属性 </td>
|
||||
</tr><tr>
|
||||
<td> cssStyle </td><td> 否 </td><td> HTML的style属性 </td>
|
||||
</tr><tr>
|
||||
<td> theme </td><td> 否 </td><td> 使用的主题 </td>
|
||||
</tr><tr>
|
||||
<td> template </td><td> 否 </td><td> 使用的模版名 </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,69 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Checkboxlist标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Checkboxlist标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="Checkboxlisttag-%26lt%3Bww%3Acheckboxlist%2F%26gt%3B"> <ww:checkboxlist /></a></h3></p>使用一个列表创建一系列复选框. 属性配置和<ww:select />或<ww:radio />相似.<p class="paragraph"><b class="strong">属性</b>
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th> 名字 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> id </td><td> 否 </td><td> HTML的id属性 </td>
|
||||
</tr><tr>
|
||||
<td> name </td><td> <b class="strong">是</b> </td><td> HTML的name属性 </td>
|
||||
</tr><tr>
|
||||
<td> value </td><td> 否 </td><td> 作为字段值的数据 </td>
|
||||
</tr><tr>
|
||||
<td> label </td><td> 否 </td><td> 用于模版中的标签文字 </td>
|
||||
</tr><tr>
|
||||
<td> labelposition </td><td> 否 </td><td> 标签的对齐方式 (left,right,center) </td>
|
||||
</tr><tr>
|
||||
<td> required </td><td> 否 </td><td> 在表单提交时是否是必需字段 </td>
|
||||
</tr><tr>
|
||||
<td> list </td><td> 否 </td><td> 可迭代的数据源 </td>
|
||||
</tr><tr>
|
||||
<td> listKey </td><td> 否 </td><td> Property of list objects to get field value from </td>
|
||||
</tr><tr>
|
||||
<td> listValue </td><td> 否 </td><td> Property of list objects to get field content from </td>
|
||||
</tr><tr>
|
||||
<td> cssClass </td><td> 否 </td><td> HTML的class属性 </td>
|
||||
</tr><tr>
|
||||
<td> cssStyle </td><td> 否 </td><td> HTML的style属性 </td>
|
||||
</tr><tr>
|
||||
<td> theme </td><td> 否 </td><td> 使用的主题 </td>
|
||||
</tr><tr>
|
||||
<td> template </td><td> 否 </td><td> 使用的模版名 </td>
|
||||
</tr>
|
||||
</table></p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,54 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 客户端校验</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 客户端校验
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Jul 22, 2004 by <font color="#0050B2">unkyaku</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">WebWork在XWork标准校验框架基础上增加了客户端校验支持. 你可以在表单中的在<<a href="UI Tags.html#UITags-form" title="form on UI Tags">ww:form</a>>标签中指定<b class="strong">validate="true"</b>来激活客户端校验:</p><div class="code"><div class="codeContent">
|
||||
<pre><ww:form name=<span class="java-quote">"'test'"</span> action=<span class="java-quote">"'javascriptValidation'"</span> validate=<span class="java-quote">"<span class="java-keyword">true</span>"</span>> ... </ww:form></pre>
|
||||
</div></div><p class="paragraph">为此你必须为表单指定<em class="emphasis">name</em>.</p>还应当确认<ww:form>标签中设置了正确的<em class="emphasis">action</em>和<em class="emphasis">namespace</em>属性. 例如, 如果有一个名为"submitProfile"的活动在名空间"/user"中, 必须使用下列代码
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:form namespace=<span class="java-quote">"'/user'"</span> action=<span class="java-quote">"'submitProfile'"</span> validate=<span class="java-quote">"<span class="java-keyword">true</span>"</span>> ... </ww:form></pre>
|
||||
</div></div><p class="paragraph">而下面的代码中, 表单可以正常工作, 客户端校验则不能:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:form action=<span class="java-quote">"'/user/submitProfile.action'"</span> validate=<span class="java-quote">"<span class="java-keyword">true</span>"</span>> ... </ww:form></pre>
|
||||
</div></div></p>当然, 这需要你已经完成了所有标准的<a href="Validation.html" title="Validation">校验配置</a>工作. 客户端教研室用于服务器端校验相同的校验规则. 如果服务器端校验不工作, 客户端校验也不工作.<br/>
|
||||
|
||||
<div class="panel"><div class="panelContent" style="background-color: #ffffce; ">
|
||||
<p class="paragraph"><img class="rendericon" src="./icons/emoticons/information.png" height="16" width="16" align="absmiddle" alt="" border="0"/> 并非全部校验器都支持客户端校验. 仅有实现ScriptValidationAware接口的校验器支持这个特性. 具体情况参见WebWork校验器列表</p><img class="rendericon" src="./icons/emoticons/information.png" height="16" width="16" align="absmiddle" alt="" border="0"/> 注意: 在<a href="UI Tags.html" title="UI Tags">UI标签</a>中的<em class="emphasis">required</em>属性并不进行任何客户端校验.
|
||||
</div></div><p class="paragraph"><br clear="all" />
|
||||
<img class="rendericon" src="./icons/emoticons/warning.png" height="16" width="16" align="absmiddle" alt="" border="0"/> <b class="strong">升级警告</b>: 该特性在WebWork 2.1引入. 如果从上个版本升级, 确认<a href="Validation.html" title="Validation">validators.xml</a>中使用了正确的校验器. 你<em class="emphasis">必须</em>使用标准XWork校验器的<b class="strong">com.opensymphony.webwork.validators.JavaScriptRequired*Validator</b>版本.
|
||||
<br clear="all" /></p><h2 class="heading2"><a name="Client-SideValidation-BuildingaValidatorthatsupportsclientsidevalidation"> 构建支持客户端校验的校验器</a></h2><p class="paragraph">任何实现<b class="strong">com.opensymphony.webwork.validators.ScriptValidationAware</b>接口的校验器都支持客户端校验:</p><div class="code"><div class="codeContent">
|
||||
<pre><span class="java-keyword">public</span> <span class="java-keyword">interface</span> ScriptValidationAware <span class="java-keyword">extends</span> FieldValidator { <span class="java-keyword">public</span> <span class="java-object">String</span> validationScript(Map parameters); }</pre>
|
||||
</div></div><p class="paragraph">如果激活了客户端校验, <b class="strong">validationScript</b>返回的字符串将在客户端表端提交前执行. 例如, <b class="strong">requiredstring</b>校验器包含下列代码:</p><div class="code"><div class="codeContent">
|
||||
<pre><span class="java-keyword">public</span> <span class="java-object">String</span> validationScript(Map parameters) { <span class="java-object">String</span> field = (<span class="java-object">String</span>) parameters.get(<span class="java-quote">"name"</span>); <span class="java-object">StringBuffer</span> js = <span class="java-keyword">new</span> <span class="java-object">StringBuffer</span>(); js.append(<span class="java-quote">"value = form.elements['"</span> + field + <span class="java-quote">"'].value;\n"</span>); js.append(<span class="java-quote">"<span class="java-keyword">if</span> (value == \"</span>\<span class="java-quote">") {\n"</span>); js.append(<span class="java-quote">"\talert('"</span> + getMessage(<span class="java-keyword">null</span>) + <span class="java-quote">"');\n"</span>); js.append(<span class="java-quote">"\treturn '"</span> + field + <span class="java-quote">"';\n"</span>); js.append(<span class="java-quote">"}\n"</span>); js.append(<span class="java-quote">"\n"</span>); <span class="java-keyword">return</span> js.toString(); }</pre>
|
||||
</div></div><p class="paragraph">目前只支持JavaScript.</p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,77 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Combobox标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Combobox标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="Comboboxtag-%26lt%3Bww%3Acombobox%2F%26gt%3B"> <ww:combobox /> </a></h3></p>组合框是由HTML的text和SELECT输入控件组合而成, 提供了组合框的功能. 它可以通过Select控件将文本放入Text中, 也可以直接在Text字段中输入. <p class="paragraph">本例中, SELECT控件使用id=year属性生成. Counter是一个迭代器(Iterator).</p><div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww:bean name=<span class="xml-quote">"'webwork.util.Counter'"</span> id=<span class="xml-quote">"year"</span>></span> <span class="xml-tag"><ww:param name=<span class="xml-quote">"'first'"</span> value=<span class="xml-quote">"text('firstBirthYear')"</span>/></span> <span class="xml-tag"><ww:param name=<span class="xml-quote">"'last'"</span> value=<span class="xml-quote">"2000"</span>/></span> <span class="xml-tag"><ww:combobox label=<span class="xml-quote">"'Birth year'"</span> size=<span class="xml-quote">"6"</span> maxlength=<span class="xml-quote">"4"</span> name=<span class="xml-quote">"'birthYear'"</span> list=<span class="xml-quote">"#year"</span>/></span> <span class="xml-tag"></ww:bean></span></pre>
|
||||
</div></div><p class="paragraph"><b class="strong">属性</b>
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th> 名字 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> id </td><td> 否 </td><td> HTML的id属性 </td>
|
||||
</tr><tr>
|
||||
<td> name </td><td> <b class="strong">是</b> </td><td> HTML的name属性 </td>
|
||||
</tr><tr>
|
||||
<td> value </td><td> 否 </td><td> 作为字段值 </td>
|
||||
</tr><tr>
|
||||
<td> list </td><td> 否 </td><td> 列表使用的可迭代数据源 </td>
|
||||
</tr><tr>
|
||||
<td> size </td><td> 否 </td><td> HTML的size属性</td>
|
||||
</tr><tr>
|
||||
<td> maxlength </td><td> 否 </td><td> HTML的maxlength属性 </td>
|
||||
</tr><tr>
|
||||
<td> disabled </td><td> 否 </td><td> HTML的disabled属性 </td>
|
||||
</tr><tr>
|
||||
<td> tabindex </td><td> 否 </td><td> HTML的tabindex属性</td>
|
||||
</tr><tr>
|
||||
<td> onkeyup </td><td> 否 </td><td> HTML的onkeyup属性</td>
|
||||
</tr><tr>
|
||||
<td> onchange </td><td> 否 </td><td> HTML的onchange属性 </td>
|
||||
</tr><tr>
|
||||
<td> onclick </td><td> 否 </td><td> HTML的onclick属性 </td>
|
||||
</tr><tr>
|
||||
<td> cssClass </td><td> 否 </td><td> HTML的class属性 </td>
|
||||
</tr><tr>
|
||||
<td> cssStyle </td><td> 否 </td><td> HTML的style属性 </td>
|
||||
</tr><tr>
|
||||
<td> label </td><td> 否 </td><td> 用于模版中的标签文字 </td>
|
||||
</tr><tr>
|
||||
<td> labelposition </td><td> 否 </td><td> 标签的对齐方式 (left,right,center) </td>
|
||||
</tr><tr>
|
||||
<td> theme </td><td> 否 </td><td> 使用的主题 </td>
|
||||
</tr><tr>
|
||||
<td> template </td><td> 否 </td><td> 使用的模版名 </td>
|
||||
</tr>
|
||||
</table></p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,83 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 通用标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 通用标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 29, 2004 by <font color="#0050B2">jcarreira</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="CommonTags-Param"> Param</a></h3>
|
||||
设置父标签的参数. 如包含在ww:url和ww:action中.
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:action name=<span class="java-quote">"VelocityCounter"</span> id=<span class="java-quote">"vc"</span>> <ww:param name=<span class="java-quote">"foo"</span> value=<span class="java-quote">"'BAR'"</span>/> </ww:action> javascript:popUp('<ww:url value=<span class="java-quote">"wiki.opensymphony.com/exec/edit"</span>><ww:param name=<span class="java-quote">"name"</span> value=<span class="java-quote">"Common Tags"</span>/></ww:url>')</pre>
|
||||
</div></div><br/>
|
||||
摘自webwork.tld:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><attribute> <name>name</name> <required><span class="java-keyword">true</span></required> <rtexprvalue><span class="java-keyword">true</span></rtexprvalue> </attribute> <attribute> <name>value</name> <required><span class="java-keyword">false</span></required> <rtexprvalue><span class="java-keyword">true</span></rtexprvalue> </attribute></pre>
|
||||
</div></div>
|
||||
<h3 class="heading3"><a name="CommonTags-Property"> Property</a></h3></p>用于获取结果属性的值. 如果value未给定, 将使用栈顶值.<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:property value=<span class="java-quote">"id"</span> <span class="java-keyword">default</span>=<span class="java-quote">"#session[OS:'customer'].id"</span>/></pre>
|
||||
</div></div><br/>
|
||||
摘自webwork.tld:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><attribute> <name>value</name> <required><span class="java-keyword">false</span></required> <rtexprvalue><span class="java-keyword">true</span></rtexprvalue> </attribute> <attribute> <name><span class="java-keyword">default</span></name> <required><span class="java-keyword">false</span></required> <rtexprvalue><span class="java-keyword">true</span></rtexprvalue> </attribute></pre>
|
||||
</div></div>
|
||||
<h3 class="heading3"><a name="CommonTags-Push"> Push</a></h3>
|
||||
使用ww:push可以将一个值压入值栈. 这与ww:set(见下文)类似, 因此在决定使用前应当都看一下.
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:push value=<span class="java-quote">"counter"</span>> <ww:property value=<span class="java-quote">"count"</span>/> </ww:push> To make an action available on the stack: <ww:action name=<span class="java-quote">"'SomeAction'"</span> id=<span class="java-quote">"sa"</span>/> <ww:push value=<span class="java-quote">"#sa"</span>> foo = <ww:property value=<span class="java-quote">"foo"</span>/> </ww:push></pre>
|
||||
</div></div><br/>
|
||||
摘自webwork.tld:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><attribute> <name>value</name> <required><span class="java-keyword">true</span></required> <rtexprvalue><span class="java-keyword">true</span></rtexprvalue> </attribute></pre>
|
||||
</div></div>
|
||||
<h3 class="heading3"><a name="CommonTags-Set"> Set</a></h3>
|
||||
使用ww:set标签, 你可以在JSP中创建一个自己命名变量. 可以使用#<em class="emphasis">variableName</em>的形式引用该变量.
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:set name=<span class="java-quote">"huba"</span> value=<span class="java-quote">"foo.bar"</span> scope=<span class="java-quote">"webwork"</span> /> <ww:property value=<span class="java-quote">"#huba.otherExpression().baz"</span>/>)</pre>
|
||||
</div></div><br/>
|
||||
摘自webwork.tld:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><info> Sets the value of an object in the VS to a scope (page, stack, application, session). If the value is not given, the top of the stack is used. If the scope is not given, the <span class="java-keyword">default</span> scope of <span class="java-quote">"webwork"</span> is used. </info> <attribute> <name>name</name> <required><span class="java-keyword">true</span></required> <rtexprvalue><span class="java-keyword">true</span></rtexprvalue> </attribute> <attribute> <name>value</name> <required><span class="java-keyword">false</span></required> <rtexprvalue><span class="java-keyword">true</span></rtexprvalue> </attribute> <attribute> <name>scope</name> <required><span class="java-keyword">false</span></required> <rtexprvalue><span class="java-keyword">true</span></rtexprvalue> </attribute></pre>
|
||||
</div></div>
|
||||
<h3 class="heading3"><a name="CommonTags-Url"> Url</a></h3>
|
||||
该标签构造一个编码的URL. 该标签的最简版本, <ww:url/>, 输出本页面的相对URL. 下面是例子:<br/>
|
||||
/jsp/cart.jsp?template=%5BLjava.lang.String%3B%40e29f36&id=%5BLjava.lang.String%3B%40429be9<br/>
|
||||
下面是更长的例子:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:url value=<span class="java-quote">"www.google.com/search"</span>> <ww:param name=<span class="java-quote">"sourceid"</span> value=<span class="java-quote">"'navclient'"</span>/> <ww:param name=<span class="java-quote">"ie"</span> value=<span class="java-quote">"'UTF-8'"</span>/> <ww:param name=<span class="java-quote">"oe"</span> value=<span class="java-quote">"'UTF-8'"</span>/> <ww:param name=<span class="java-quote">"q"</span> value=<span class="java-quote">"'webwork'"</span>/> </ww:url></pre>
|
||||
</div></div><br/>
|
||||
输出结果为:<br/>
|
||||
<a href="http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=webwork" title="Visit page outside Confluence">http://www.google.com/search?sourceid=navclient&ie=UTF-8&oe=UTF-8&q=webwork</a><p class="paragraph">摘自webwork.tld:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><attribute> <name>value</name> <required><span class="java-keyword">false</span></required> <rtexprvalue><span class="java-keyword">false</span></rtexprvalue> </attribute> <attribute> <name>id</name> <required><span class="java-keyword">false</span></required> <rtexprvalue><span class="java-keyword">false</span></rtexprvalue> </attribute></pre>
|
||||
</div></div></p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,63 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Component标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Component标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="Componenttag-%26lt%3Bww%3Acomponent%2F%26gt%3B"> <ww:component /> </a></h3></p>用指定模版绘制的定制的UI组件. 可以使用param标签将其他对象传到模版中. 在模版中可以使用 $parameters._<em class="emphasis">paramname</em>_取得这些对象. <p class="paragraph">在下面的JSP和Velocity的例子中, 向组件传递了两个参数. 在组件内部, 可以使用$parameters.get('key1')和$parameters.get('key2')来访问参数. Velocity也允许使用$parameters.key1和$parameters.key2来引用参数.</p>目前, 定制UI组件<b class="strong">必须</b>编写在Velocity中.<p class="paragraph"><b class="strong">记住:</b> 参数值总是通过OgnlValueStack得到, 因此如果想要向组件传递字符串文本, 一定要用引号将它括起来, 例如: value="'value1'". 否则将从值栈中搜索具有方法getValue1()的对象. (在我编写这部分的时候, 还不能完全确信会是这样. 我会验证这一情况)</p><b class="strong">用法示例</b>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>JSP <span class="xml-tag"><ww:component template=<span class="xml-quote">"/my/custom/component.vm"</span>/></span> or <span class="xml-tag"><ww:component template=<span class="xml-quote">"/my/custom/component.vm"</span>></span> <span class="xml-tag"><ww:param name=<span class="xml-quote">"key1"</span> value=<span class="xml-quote">"value1"</span>/></span> <span class="xml-tag"><ww:param name=<span class="xml-quote">"key2"</span> value=<span class="xml-quote">"value2"</span>/></span> <span class="xml-tag"></ww:component></span> Velocity #tag( Component <span class="xml-quote">"template=/my/custom/component.vm"</span> ) or #bodytag( Component <span class="xml-quote">"template=/my/custom/component.vm"</span> ) #param( <span class="xml-quote">"key1"</span> <span class="xml-quote">"value1"</span> ) #param( <span class="xml-quote">"key2"</span> <span class="xml-quote">"value2"</span> ) #end</pre>
|
||||
</div></div><p class="paragraph"><b class="strong">属性</b>
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th> 名字 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> id </td><td> 否 </td><td> HTML的id属性 </td>
|
||||
</tr><tr>
|
||||
<td> name </td><td> <b class="strong">是</b> </td><td> HTML的name属性 </td>
|
||||
</tr><tr>
|
||||
<td> value </td><td> 否 </td><td> 作为字段值 </td>
|
||||
</tr><tr>
|
||||
<td> label </td><td> 否 </td><td> 用于模版中的标签文字 </td>
|
||||
</tr><tr>
|
||||
<td> labelposition </td><td> 否 </td><td> 标签的对齐方式 (left,right,center) </td>
|
||||
</tr><tr>
|
||||
<td> required </td><td> 否 </td><td> 在表单提交时是否是必需字段 </td>
|
||||
</tr><tr>
|
||||
<td> cssClass </td><td> 否 </td><td> HTML的class属性 </td>
|
||||
</tr><tr>
|
||||
<td> cssStyle </td><td> 否 </td><td> HTML的style属性 </td>
|
||||
</tr><tr>
|
||||
<td> theme </td><td> 否 </td><td> 使用的主题 </td>
|
||||
</tr><tr>
|
||||
<td> template </td><td> 否 </td><td> 使用的模版名 </td>
|
||||
</tr>
|
||||
</table></p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,45 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 组件</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 组件
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Jun 18, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="Components-Overview"> 综述</a></h2></p>WebWork建立在XWork的组件实现之上, 提供组件对象的生命周期管理并使组件在需要时可以用于活动类(或其他任何用户代码中). <p class="paragraph">WebWork中有两种类型的类可以使用enabler接口实现反转控制: 活动和组件. 为了让活动类拥有它自己的组件集合, 必须使用ComponentInterceptor为活动设置资源. 同样的, 如果这些组件需要初始化并使用其他组件, 这些初始化活动将在ComponentInterceptor截取活动的时候进行.</p><h2 class="heading2"><a name="Components-ScopesandLifecycle">范围(Scope)和生命周期</a></h2><p class="paragraph">在WebWork中组件可以被配置成存在于三个范围中:
|
||||
<ol>
|
||||
<li> 一个请求期间,</li>
|
||||
<li> 跨越一个用户会话, 或</li>
|
||||
<li> Web应用的整个运行周期.</li>
|
||||
</ol><br/>
|
||||
WebWork 延迟加载(lazy load)组件, 这意味着无论哪一范围的组件, 都在使用是开始初始化并在范围的生命周期结束时销毁. 也就是说, 一个application范围的组件, for example, 将在第一个实现组件的Enabler接口的活动的用户请求时初始化, 并在应用结束时被销毁.</p>组件可以依赖于其他组件, 但不能依赖于更小范围的组件. 因此, 一个session范围的组件不能依赖于一个请求范围的组件.<p class="paragraph">所有组件必需注册在components.xml中, 对该文件的描述在"配置"一节中.</p><h2 class="heading2"><a name="Components-ObtainingaComponentManager"> 获取ComponentManager</a></h2><p class="paragraph">每一次请求时都存在三个组件管理器, 每个范围一个. 他们作为一个属性"DefaultComponentManager"存在于他们代表的范围对象中. 因此, 如果你需要一个request范围的ComponentManager对象, 使用下面的代码:</p><div class="code"><div class="codeContent">
|
||||
<pre>ComponentManager cm = (ComponentManager) request.getAttribute(<span class="java-quote">"DefaultComponentManager"</span>);</pre>
|
||||
</div></div>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,73 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 配置</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 配置
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Jun 18, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">WebWork有两个配置文件需要了解: web.xml和xwork.xml. 本文描述了WebWork必需的和可选的配置文件的全部信息.</p><ol>
|
||||
<li> <a href="web.xml.html" title="web.xml">web.xml</a></li>
|
||||
<li> <a href="xwork.xml.html" title="xwork.xml">xwork.xml</a></li>
|
||||
<li> <a href="webwork-default.xml.html" title="webwork-default.xml">webwork-default.xml</a></li>
|
||||
<li> <a href="Results.html" title="Results">结果</a><ol>
|
||||
<li> <a href="Global results.html" title="Global results">全局结果</a></li>
|
||||
<li> <a href="Default results.html" title="Default results">缺省结果</a></li>
|
||||
</ol></li>
|
||||
<li> <a href="Interceptors.html" title="Interceptors">截取器</a></li>
|
||||
<li> <a href="Packages.html" title="Packages">包</a></li>
|
||||
<li> <a href="Namespaces.html" title="Namespaces">名空间(Namespace)</a></li>
|
||||
<li> <a href="Reloading configuration.html" title="Reloading configuration">重加载配置文件</a></li>
|
||||
<li> <a href="webwork.properties.html" title="webwork.properties">webwork.properties</a></li>
|
||||
<li> <a href="velocity.properties.html" title="velocity.properties">velocity.properties</a></li>
|
||||
</ol><br/>
|
||||
下文列出你需要了解的全部文件. <br/>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>文件</th><th>可选</th><th>位置(与webapp相对路径)</th><th>用途</th>
|
||||
</tr><tr>
|
||||
<td><a href="web.xml.html" title="web.xml">web.xml</a></td><td>否</td><td>/WEB-INF/</td><td>Web部署描述文件, 包含全部必需的WebWork组件</td>
|
||||
</tr><tr>
|
||||
<td><a href="xwork.xml.html" title="xwork.xml">xwork.xml</a></td><td>否</td><td>/WEB-INF/classes/</td><td>主配置文件, 包括result/view类型, 活动映射, 截取器等</td>
|
||||
</tr><tr>
|
||||
<td><a href="webwork.properties.html" title="webwork.properties">webwork.properties</a></td><td>是</td><td>/WEB-INF/classes/</td><td>WebWork的属性文件</td>
|
||||
</tr><tr>
|
||||
<td><a href="webwork-default.xml.html" title="webwork-default.xml">webwork-default.xml</a></td><td>是</td><td>/WEB-INF/lib/webwork-x.x.jar</td><td>应当包含在xwork.xml中的缺省配置</td>
|
||||
</tr><tr>
|
||||
<td><a href="velocity.properties.html" title="velocity.properties">velocity.properties</a></td><td>是</td><td>/WEB-INF/classes/</td><td>覆盖velocity的缺省配置</td>
|
||||
</tr><tr>
|
||||
<td><a href="Validation.html" title="Validation">validators.xml</a></td><td>yes</td><td>/WEB-INF/classes/</td><td>定义输入校验器</td>
|
||||
</tr><tr>
|
||||
<td>components.xml</td><td>/WEB-INF/classes/</td><td>定义IOC组件</td>
|
||||
</tr><tr>
|
||||
<td>taglib.tld</td><td>否</td><td>/WEB-INF/lib/webwork-x.x.jar </td><td> Webwork标签库描述文件 </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,57 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 经验谈(cookbook)</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 经验谈(cookbook)
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
本页由<font color="#0050B2">casey</font>最后修改于2004年12月14日.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="Cookbook-WebworkCookbook"> 经验谈(cookbook)</a></h2>
|
||||
欢迎浏览Webwork经验谈. 本页为开发者之间提供信息交换. 欢迎您在此共享知识和有价值的提示.</p><a href="Accessing application, session, request objects.html" title="Accessing application, session, request objects">Accessing application, session, request objects</a><br/>
|
||||
<a href="Iterator tag examples.html" title="Iterator tag examples">Iterator tag examples</a><br/>
|
||||
<a href="Exposing webwork objects to JSTL, with a JSTL and DisplayTag Example.html" title="Exposing webwork objects to JSTL, with a JSTL and DisplayTag Example">Exposing webwork objects to JSTL, with a JSTL and DisplayTag Example</a><br/>
|
||||
<a href="Value Stack Internals.html" title="Value Stack Internals">Value Stack Internals</a><br/>
|
||||
<a href="Using WebWork Components.html" title="Using WebWork Components">Using WebWork Components</a><br/>
|
||||
<a href="Webwork 2 file upload handling.html" title="Webwork 2 file upload handling">Webwork 2 file upload handling</a><br/>
|
||||
<a href="How do I populate a form bean and get the value using the taglib.html" title="How do I populate a form bean and get the value using the taglib">How do I populate a form bean and get the value using the taglib</a><br/>
|
||||
<a href="Interceptor Order.html" title="Interceptor Order">Interceptor Order</a><br/>
|
||||
<a href="Tabular inputs with XWorkList.html" title="Tabular inputs with XWorkList">Tabular inputs with XWorkList</a><br/>
|
||||
<a href="Using WebWork2 and XWork1 with JSP 2.0 and JSTL 1.1.html" title="Using WebWork2 and XWork1 with JSP 2.0 and JSTL 1.1">Using WebWork2 and XWork1 with JSP 2.0 and JSTL 1.1</a><br/>
|
||||
<a href="Webwork 2 skinning.html" title="Webwork 2 skinning">Webwork 2 skinning</a><br/>
|
||||
<a href="Transparent web-app I18N.html" title="Transparent web-app I18N">Transparent web-app I18N</a><br/>
|
||||
<a href="Webwork 2 HTML form buttons Howto.html" title="Webwork 2 HTML form buttons Howto">Webwork 2 HTML form buttons Howto</a><br/>
|
||||
<a href="Using Checkboxes.html" title="Using Checkboxes">Using Checkboxes</a><br/>
|
||||
<a href="JFreeChartResult.html" title="JFreeChartResult">JFreeChartResult</a><br/>
|
||||
<a href="Webwork reference to OGNL access.html" title="Webwork reference to OGNL access">Webwork reference to OGNL access</a><br/>
|
||||
<a href="Application, Session, Request objects in jsp.html" title="Application, Session, Request objects in jsp">Application, Session, Request objects in jsp</a><br/>
|
||||
<a href="Application, Session, Request objects in vm.html" title="Application, Session, Request objects in vm">Application, Session, Request objects in vm</a><br/>
|
||||
<a href="Describing a bean in velocity.html" title="Describing a bean in velocity">Describing a bean in velocity</a><br/>
|
||||
<a href="File Upload Interceptor.html" title="File Upload Interceptor">File Upload Interceptor</a><br/>
|
||||
<a href="Resources Available to Velocity Views.html" title="Resources Available to Velocity Views">Resources Available to Velocity Views</a>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,38 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 缺省结果</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 缺省结果
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 13, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">Webwork能为活动定义一个缺省结果类型. 因此, 你不必指定结果类型. 如果一个包扩展了另一个包而没有为子包指定新的缺省结果类型, 当result元素的type属性未指定时也将使用父包的缺省结果类型.</p><div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><span class="xml-comment"><!-- parts of xwork.xml --></span></span> .... <span class="xml-tag"><result-types></span> <span class="xml-tag"><result-type name=<span class="xml-quote">"dispatcher"</span> class=<span class="xml-quote">"com.opensymphony.webwork.dispatcher.ServletDispatcherResult"</span> default=<span class="xml-quote">"true"</span>/></span> <span class="xml-tag"><result-type name=<span class="xml-quote">"redirect"</span> class=<span class="xml-quote">"com.opensymphony.webwork.dispatcher.ServletRedirectResult"</span>/></span> <span class="xml-tag"><result-type name=<span class="xml-quote">"velocity"</span> class=<span class="xml-quote">"com.opensymphony.webwork.dispatcher.VelocityResult"</span>/></span> <span class="xml-tag"></result-types></span> .... <span class="xml-tag"><action name=<span class="xml-quote">"bar"</span> class=<span class="xml-quote">"myPackage.barAction"</span>></span> <span class="xml-tag"><span class="xml-comment"><!-- this result uses dispatcher, so you can omit the type=<span class="xml-quote">"dispatcher"</span> if you want --></span></span> <span class="xml-tag"><result name=<span class="xml-quote">"success"</span>></span>foo.jsp<span class="xml-tag"></result></span> <span class="xml-tag"><span class="xml-comment"><!-- this result uses velocity result, so the type needs to be specified --></span></span> <span class="xml-tag"><result name=<span class="xml-quote">"error"</span> type=<span class="xml-quote">"velocity"</span>></span>error.vm<span class="xml-tag"></result></span> <span class="xml-tag"></action></span> ....</pre>
|
||||
</div></div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,40 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 依赖类库</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 依赖类库
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Aug 26, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">依赖类库分为运行时和编译时两部分.</p><ul class="star">
|
||||
<li> 运行时依赖类库存放在CVS的lib/core目录下.</li>
|
||||
<li> 编译时依赖类库存放在CVS的lib/build目录下.</li>
|
||||
</ul><br/>
|
||||
你可以在上述目录的libraries.txt文件中查找到它们的版本号.
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,49 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 部署WebWork注意事项</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 部署WebWork注意事项
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
本页由<font color="#0050B2">plightbo</font>最后修改于2004年5月24日.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">WebWork可以在大部分应用服务器上运行而没有任何问题. 尽管如此, 你可能还是需要做不多的改动以便在你的环境下运行.</p><h3 class="heading3"><a name="DeploymentNotes-WebLogic6.1"> WebLogic 6.1</a></h3>
|
||||
一个子项目已被加入WebWork的CVS仓库中, 它极大的简化了使WebWork在BEA Weblogic Server 6.1下运行所需的的修改工作. 相关文档也包含在其中.<br/>
|
||||
该子项目位于目录"misc"中.<p class="paragraph"><h3 class="heading3"><a name="DeploymentNotes-SunONE7.0"> SunONE 7.0</a></h3></p>需要为WebWork分配许可:<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>grant { permission java.security.AllPermission; };</pre>
|
||||
</div></div><p class="paragraph">或更明确地,</p><ul type="square" class="minus">
|
||||
<li> 分配对java.util.PropertyPermission的写许可.</li>
|
||||
<li> 增加java.lang.reflect.ReflectPermission "suppressAccessChecks"</li>
|
||||
<li> OgnlInvoke许可</li>
|
||||
</ul>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>grant { permission java.util.PropertyPermission <span class="java-quote">"*"</span>, <span class="java-quote">"read, write"</span>; permission java.lang.reflect.ReflectPermission <span class="java-quote">"suppressAccessChecks"</span>; permission ognl.OgnlInvokePermission <span class="java-quote">"*"</span>; };</pre>
|
||||
</div></div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,53 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Describing a bean in velocity</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Describing a bean in velocity
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 10, 2004 by <font color="#0050B2">sutter2k</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">The follow snippet might be useful during debugging to list the properties inside an<br/>
|
||||
arbitary bean. Or for handing to a UI developer that use unaware of the getters/setters inside an object.</p><div class="code"><div class="codeContent">
|
||||
<pre>## prints out the property names <span class="java-keyword">for</span> a bean #macro (describeBean $name) #set($bu = $webwork.bean(<span class="java-quote">"com.opensymphony.util.BeanUtils"</span>)) #foreach($propName in $bu.getPropertyNames($name)) <li>$propName</li> #end #end</pre>
|
||||
</div></div><p class="paragraph">i.e. assuming $obj is a PersonObject that has properties(firstName, lastName, and zip).
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>#describeBean($obj)</pre>
|
||||
</div></div><br/>
|
||||
would print<br/>
|
||||
<li>firstName</li><br/>
|
||||
<li>lastName</li><br/>
|
||||
<li>zip</li></p>One might also expand upon this to build a dynamic interface with via reflection. e.g.
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>$webwork.evalute(<span class="java-quote">"$obj.${propName}"</span>)</pre>
|
||||
</div></div><br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,49 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Dispatcher Result</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Dispatcher Result
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 13, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h4 style="margin: 4px 0px 4px 0px;" class="heading4"><a name="DispatcherResult-Dispatcher"> 分发器</a></h4>
|
||||
包含或前进到一个视图(通常是JSP). WebWork使用RequestDispatcher, 而目标servlet/JSP会收到与原始Servlet/JSP相同的request/response对象. 因此, 你可以使用request.setAttribute()在它们之间传递参数 – WebWork的活动也可以使用.</p><table class="wikitable">
|
||||
<tr>
|
||||
<th>参数 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> location </td><td> <b class="strong">是</b> </td><td> 执行后跳转的位置(例如: jsp) </td>
|
||||
</tr><tr>
|
||||
<td> parse </td><td> 否 </td><td> 缺省为true. 如果设为false, location参数将不作为Ognl表达式进行解析 </td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"dispatcher"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"location"</span>></span>foo.jsp<span class="xml-tag"></param></span> <span class="xml-tag"></result></span></pre>
|
||||
</div></div>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,91 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Documentation</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Documentation
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
本页由<font color="#0050B2">casey</font>最后修改于2004年12月24日.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="Documentation-1.Overview"> 1. 综述</a></h3></p><ol>
|
||||
<li> <a href="What is WebWork.html" title="What is WebWork">什么是WebWork</a></li>
|
||||
<li> <a href="License.html" title="License">许可(License)</a></li>
|
||||
<li> <a href="Getting Started.html" title="Getting Started">开始WebWork之旅</a></li>
|
||||
<li> <a href="FAQ.html" title="FAQ">常见问题解答</a></li>
|
||||
<li> <a href="Cookbook.html" title="Cookbook">经验谈(cookbook)</a></li>
|
||||
<li> <a href="Deployment Notes.html" title="Deployment Notes">部署WebWork注意事项</a></li>
|
||||
<li> <a href="WebWork Community.html" title="WebWork Community">WebWork团体</a><ol>
|
||||
<li> <a href="Mailing lists.html" title="Mailing Lists">邮件列表</a></li>
|
||||
<li> <a href="Bug tracker and wiki.html" title="Bug tracker and wiki">Bug跟踪和wiki</a></li>
|
||||
</ol></li>
|
||||
<li> <a href="Articles.html" title="Articles">关于WebWork的文章和出版物</a></li>
|
||||
<li> <a href="Projects Using WebWork.html" title="Projects Using WebWork">使用WebWork的项目</a></li>
|
||||
<li> <a href="Comparison to Struts.html" title="Comparison to Struts">与Struts的比较</a></li>
|
||||
<li> <a href="WebFlow.html" title="WebFlow">WebFlow</a> - WebWork曲线图工具</li>
|
||||
<li> <a href="App Servers.html" title="App Servers">应用服务器</a> - 针对不同应用服务器的提示与窍门</li>
|
||||
</ol>
|
||||
<h3 class="heading3"><a name="Documentation-2.WebWorkversions"> 2. WebWork版本</a></h3>
|
||||
|
||||
<ul class="star">
|
||||
<li> 当前版本 - <a href="WebWork 2.1.7.html" title="WebWork 2.1.7">WebWork 2.1.7</a></li>
|
||||
<li> <a href="Previous releases.html" title="Previous releases">旧版本</a> - 旧版本WebWork的信息</li>
|
||||
<li> <a href="Dependencies.html" title="Dependencies">依赖类库</a></li>
|
||||
</ul>
|
||||
<h3 class="heading3"><a name="Documentation-3.Tutorial"> 3. 指南</a></h3>
|
||||
<ol>
|
||||
<li> <a href="TutorialLesson01.html" title="TutorialLesson01">第一课: 下载并安装WebWork</a></li>
|
||||
<li> <a href="TutorialLesson02.html" title="TutorialLesson02">第二课: 设置Web应用</a></li>
|
||||
<li> <a href="TutorialLesson03.html" title="TutorialLesson03">第三课: 活动和结果</a></li>
|
||||
<li> <a href="TutorialLesson04.html" title="TutorialLesson04">第四课: 视图</a> (JSP, Velocity, Freemarker)</li>
|
||||
<li> <a href="TutorialLesson05.html" title="TutorialLesson05">第五课: 截取器(Interceptors)</a></li>
|
||||
</ol>
|
||||
<h3 class="heading3"><a name="Documentation-4.ReferenceGuide"> 4. 参考指南</a></h3>
|
||||
<ol>
|
||||
<li> <a href="Configuration.html" title="Configuration">配置</a></li>
|
||||
<li> <a href="Interceptors.html" title="Interceptors">截取器</a></li>
|
||||
<li> <a href="Action Chaining.html" title="Action Chaining">活动链</a></li>
|
||||
<li> <a href="Inversion of Control.html" title="Inversion of Control">反转控制(IoC)</a></li>
|
||||
<li> <a href="JSP Tags.html" title="JSP Tags">JSP标签</a></li>
|
||||
<li> <a href="JSP Expression Language Comparison with WebWork 1.x.html" title="JSP Expression Language Comparison with WebWork 1.x">JSP Expression Language Comparison with WebWork 1.x</a></li>
|
||||
<li> <a href="WebWork Freemarker Support.html" title="WebWork Freemarker Support">WebWork对Freemarker的支持</a></li>
|
||||
<li> <a href="Result Types.html" title="Result Types">结果类型</a></li>
|
||||
<li> <a href="Type Conversion.html" title="Type Conversion">类型转换</a></li>
|
||||
<li> <a href="Validation.html" title="Validation">校验</a></li>
|
||||
<li> <a href="OGNL.html" title="OGNL">OGNL</a></li>
|
||||
<li> <a href="Internationalization.html" title="Internationalization">国际化</a></li>
|
||||
</ol>
|
||||
<h3 class="heading3"><a name="Documentation-5.Thirdpartyintegration"> 5. 与第三方集成</a></h3>
|
||||
<ol>
|
||||
<li> <a href="SiteMesh.html" title="SiteMesh">SiteMesh</a></li>
|
||||
<li> <a href="Spring.html" title="Spring">Spring</a></li>
|
||||
<li> <a href="Pico.html" title="Pico">Pico</a></li>
|
||||
<li> <a href="Hibernate.html" title="Hibernate">Hibernate</a></li>
|
||||
<li> <a href="JUnit.html" title="JUnit">JUnit</a></li>
|
||||
<li> <a href="Quartz.html" title="Quartz">Quartz</a></li>
|
||||
</ol>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,48 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : ExecuteAndWaitInterceptor</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : ExecuteAndWaitInterceptor
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 01, 2004 by <font color="#0050B2">mbogaert</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">The ExecuteAndWaitInterceptor is great for running long-lived actions in the background while showing the user a nice progress meter. This also prevents the HTTP request from timing out when the action takes more than 5 or 10 minutes.</p>Using this interceptor is pretty straight forward. Assuming that you are including <a href="webwork-default.xml.html" title="webwork-default.xml">webwork-default.xml</a>, this interceptor is already configured but is not part of any of the default stacks. Because of the nature of this interceptor, it must be the <b class="strong">last</b> interceptor in the stack. A typical configuration looks like:<br/>
|
||||
|
||||
<div class="code"><div class="codeHeader"><b>xwork.xml</b></div><div class="codeContent">
|
||||
<pre>... <span class="xml-tag"><action name=<span class="xml-quote">"myLongRunningAction"</span> class=<span class="xml-quote">"..."</span>></span> <span class="xml-tag"><interceptor-ref name=<span class="xml-quote">"defaultStack"</span>/></span> <span class="xml-tag"><interceptor-ref name=<span class="xml-quote">"execAndWait"</span>/></span> <span class="xml-tag"><result name=<span class="xml-quote">"wait"</span>></span>longRunningAction-wait.jsp<span class="xml-tag"></result></span> <span class="xml-tag"><result name=<span class="xml-quote">"success"</span>></span>longRunningAction-success.jsp<span class="xml-tag"></result></span> <span class="xml-tag"></action></span> ...</pre>
|
||||
</div></div><p class="paragraph">This interceptor works on a per-session basis. That means that the same action name (<em class="emphasis">myLongRunningAction</em>, in the above example) cannot be run more than once at a time in a given session. On the initial request or any subsequent requests (before the action has completed), the <b class="strong">wait</b> result will be returned. The wait result <b class="strong">is responsible for issuing a subsequent request back to the action, giving the effect of a self-updating progress meter</b>.</p>An example of a simple wait JSP is:<br/>
|
||||
|
||||
<div class="code"><div class="codeHeader"><b>longRunningAction-wait.jsp</b></div><div class="codeContent">
|
||||
<pre><span class="xml-tag"><html></span> <span class="xml-tag"><head></span> <span class="xml-tag"><title></span>Please wait<span class="xml-tag"></title></span> <span class="xml-tag"><meta http-equiv=<span class="xml-quote">"refresh"</span> content=<span class="xml-quote">"5;url=<ww:url includeParams="</span>'all'<span class="xml-quote">" /></span>"</span>/> <span class="xml-tag"></head></span> <span class="xml-tag"><body></span> Please wait while we process your request. Click <span class="xml-tag"><a href=<span class="xml-quote">"<ww:url includeParams="</span>'all'<span class="xml-quote">" /></span>"</span>><span class="xml-tag"></a></span> if this page does not reload automatically. <span class="xml-tag"></body></span></pre>
|
||||
</div></div><p class="paragraph">Whenever the wait result is returned, the <b class="strong">action that is currently running in the background will be placed on top of the stack</b>. This allow you to display progress data, such as a count, in the wait page. By making the wait page automatically reload the request to the action (which will be short-circuited by the interceptor), you can give the appearance of an automatic progress meter.</p>To set the Thread priority, add the parameter <em class="emphasis">threadPriority</em> (defaults to Thread.NORM_PRIORITY):<br/>
|
||||
|
||||
<div class="code"><div class="codeHeader"><b>xwork.xml</b></div><div class="codeContent">
|
||||
<pre><span class="xml-tag"><interceptor name=<span class="xml-quote">"execAndWait"</span> class=<span class="xml-quote">"com.opensymphony.webwork.interceptor.ExecuteAndWaitInterceptor"</span>/></span> <span class="xml-tag"><interceptor-stack name=<span class="xml-quote">"defaultStack"</span>></span> ... <span class="xml-tag"><interceptor-ref name=<span class="xml-quote">"execAndWait"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"threadPriority"</span>></span>10<span class="xml-tag"></param></span> <span class="xml-tag"></interceptor-ref></span> <span class="xml-tag"></interceptor-stack></span></pre>
|
||||
</div></div><p class="paragraph">The thread will receive the name of the action with 'BackgroundThread' appended.</p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
+43
File diff suppressed because one or more lines are too long
@@ -0,0 +1,125 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 常见问题解答</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 常见问题解答
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
本页由<font color="#0050B2">lagcisco</font>最后修改2005-3-2于2004年10月18日.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><b class="strong">值栈中的缺省值是什么? (使用#foo访问)</b><br/>
|
||||
attr (按照顺序扫描request, session和application属性)<br/>
|
||||
request (request attributes)<br/>
|
||||
session (session attributes)<br/>
|
||||
application (application attributes)<br/>
|
||||
parameters (request params)</p><b class="strong">How do I get the latest version of Webwork and XWork from CVS?</b><br/>
|
||||
cvs -d :pserver:guest@cvs.dev.java.net:/cvs login<br/>
|
||||
(Use an empty password, just hit enter..)<br/>
|
||||
cvs -d :pserver:guest@cvs.dev.java.net:/cvs checkout webwork<br/>
|
||||
cvs -d :pserver:guest@cvs.dev.java.net:/cvs checkout xwork<p class="paragraph">Note: WebWork from the CVS does not compile with the latest 1.5 J2sdk. Use the stable J2sdk 1.4.2.</p><b class="strong">How do I build the latest versions XWork and Webwork?</b><br/>
|
||||
Just go into the XWork or WebWork directories and run 'ant' (you must have ant installed and have the jars of junit and clover inside $ANT_HOME/lib)<p class="paragraph">Once you have built the xwork.jar copy it into the webwork/lib/core folder, and delete the old one.</p><b class="strong">How do I use messages from within the validator?</b>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><validators></span> <span class="xml-tag"><field name=<span class="xml-quote">"name"</span>></span> <span class="xml-tag"><field-validator type=<span class="xml-quote">"requiredstring"</span>></span> <span class="xml-tag"><message key=<span class="xml-quote">"template.name.errors.required"</span>></span>A default message in case the key is not found<span class="xml-tag"></message></span> <span class="xml-tag"></field-validator></span> <span class="xml-tag"></field></span> <span class="xml-tag"></validators></span></pre>
|
||||
</div></div><p class="paragraph"><b class="strong">How do I set a global resource bundle?</b></p>In webwork.properties(as of Webwork 2.1.1), <br/>
|
||||
you can now use:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>webwork.custom.i18n.resources=global-messages</pre>
|
||||
</div></div><br/>
|
||||
Serveral resource bundles can be specified by comma separating them.<br/>
|
||||
for example see webwork.properties :<br/>
|
||||
<a href="http://wiki.opensymphony.com/display/WW/webwork.properties" title="Visit page outside Confluence">http://wiki.opensymphony.com/display/WW/webwork.properties</a><p class="paragraph">Java class (thanks Drew McAuliffe):
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="java-keyword">public</span> class WebworkGlobalMessagesListener <span class="java-keyword">implements</span> ServletContextListener { <span class="java-keyword">private</span> <span class="java-keyword">static</span> Logger log = Logger.getLogger(WebworkGlobalMessagesListener.class); <span class="java-keyword">private</span> <span class="java-keyword">static</span> <span class="java-keyword">final</span> <span class="java-object">String</span> DEFAULT_RESOURCE = <span class="java-quote">"global-messages"</span>; /** * Uses the LocalizedTextUtil to load messages from the global message bundle. * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.Servle tContextEvent) */ <span class="java-keyword">public</span> void contextInitialized(ServletContextEvent arg0) { log.info(<span class="java-quote">"Loading global messages from "</span> + DEFAULT_RESOURCE); LocalizedTextUtil.addDefaultResourceBundle(DEFAULT_RESOURCE); log.info(<span class="java-quote">"Global messages loaded."</span>); } /** * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent) */ <span class="java-keyword">public</span> void contextDestroyed(ServletContextEvent arg0) { <span class="java-comment">// <span class="java-keyword">do</span> nothing</span> } }</pre>
|
||||
</div></div><br/>
|
||||
web.xml:<br/>
|
||||
(under listeners section)
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><listener></span> <span class="xml-tag"><listener-class></span>mypackagename.WebworkGlobalMessagesListener<span class="xml-tag"></listener-class></span> <span class="xml-tag"></listener></span></pre>
|
||||
</div></div></p><b class="strong">How do I change the error message for invalid inputted fields?</b><br/>
|
||||
You need to create a message for that field, for example if you have a user.dob field you would use this in your messages file (see above for example on setting a global messages file): <br/>
|
||||
invalid.fieldvalue.user.dob=Please enter Date of Birth in the correct format.<p class="paragraph"><b class="strong">How do I get access to the Session?</b><br/>
|
||||
ActionContext.getContext().getSession() (returns Map, works internally using a ThreadLocal)</p><b class="strong">How can I see all parameters passed into the Action?</b><br/>
|
||||
ActionContext.getParameters() (returns Map, works internally using a ThreadLocal)<p class="paragraph"><b class="strong">How can I get the HttpServletRequest?</b><br/>
|
||||
ServletActionContext.getRequest() (works internally using a ThreadLocal)</p><b class="strong">How can I use the IOC container to initialize a component in another object that isnt an action?</b><br/>
|
||||
Obtain the ComponentManager from the request: ComponentManager cm = (ComponentManager) ServletActionContext.getRequest().getAttribute("DefaultComponentManager");<br/>
|
||||
then you need to initialize it using: cm.initializeObject(Object)<p class="paragraph"><b class="strong">How do I decouple XWork LocalizedTextUtil global resource bundle loading from serlvets (ServletContextListener)?</b><br/>
|
||||
If you're using XWork outside a Web context, then use whatever startup hooks you have in that context (i.e. application start for a desktop app) to add the global resource bundle. This is a startup activity, so use whatever mechanisms are provided in the context you're running in.</p><b class="strong">What i need to do to put values in a combobox. If I am using webwork2?</b><br/>
|
||||
If i have :
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>#tag(Select <span class="java-quote">"label='xxx '"</span> <span class="java-quote">"name='xxx'"</span> <span class="java-quote">"list=?"</span>) or #tag(combobox <span class="java-quote">"label='Prioridade'"</span> <span class="java-quote">"name='inavis.avisTpPrioridade'"</span> <span class="java-quote">"list=?"</span>)</pre>
|
||||
</div></div><br/>
|
||||
the values in this combobox, what i need to do?<br/>
|
||||
Exemple:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>html tag i use to <span class="java-keyword">do</span>: <select..> <otpion value="" selected>XXX</option> </selct></pre>
|
||||
</div></div><br/>
|
||||
so...i need to do this using Webwork tags from Velocity...how can i do this??<p class="paragraph"><b class="strong">How do I add I18N to a UI tag, like ww:textfield?</b>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:textfield label=<span class="java-quote">"'i18n.label'"</span> name=<span class="java-quote">"'label1'"</span> value=<span class="java-quote">"''"</span>></pre>
|
||||
</div></div><br/>
|
||||
This will get the localized text message for the key "i18n.label" and put it in the label.
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:textfield label=<span class="java-quote">"getText('i18n.label')"</span> name=<span class="java-quote">"'label1'"</span> value=<span class="java-quote">"''"</span>></pre>
|
||||
</div></div></p>Alternatively, you could modify controlheader.vm and copy it to /template/xhtml. There you could make it so that it automatically does a call to $stack.findValue("getText($parameters.label)"), making the first example actually work for i18n.<p class="paragraph"><b class="strong">Can I add I18N outside the Action's context? i.e. adding i18n to some JSP using the ww taglib?</b><br/>
|
||||
Yes, use the <ww:i18n> tag to push a resource bundle on to the stack. Now calls with <ww:text/> or <ww:property value="getText(...)"/> will read from that resource bundle.</p><b class="strong">Can I break up my large XWork.xml file into smaller pieces?</b><br/>
|
||||
Sure, that's what the <include> element is for. Most xwork.xml files<br/>
|
||||
already have one: <br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><xwork> <include file=<span class="java-quote">"webwork-<span class="java-keyword">default</span>.xml"</span>/> <include file=<span class="java-quote">"config-browser.xml"</span>/> <<span class="java-keyword">package</span> name=<span class="java-quote">"<span class="java-keyword">default</span>"</span> <span class="java-keyword">extends</span>=<span class="java-quote">"webwork-<span class="java-keyword">default</span>"</span>> .... </<span class="java-keyword">package</span>> <include file=<span class="java-quote">"other.xml"</span>/> </xwork></pre>
|
||||
</div></div><p class="paragraph">This tells it to load the webwork-default.xml from the webwork jar file<br/>
|
||||
to get all of those interceptor and result definitions.</p>You can put your own <include> in your xwork.xml interchangeably with<br/>
|
||||
<package> elements… They will be loaded in the same order as it reads<br/>
|
||||
from top to bottom and adds things as it reads them.<p class="paragraph"><b class="strong">How can I put a String literal in a Javascript call, for instance in an onChange attribute?</b></p>The problem is in escaping quotes and getting the double quotes around the final value, like we expect in HTML attributes. Here's an example of the right way to do this (thanks to John Brad):<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>onchange='<span class="java-quote">"someFunc(<span class="java-keyword">this</span>.form, \'abc\')"</span>'</pre>
|
||||
</div></div><p class="paragraph">Notice here that there are single quotes surrounding the double quotes, and then the single quotes inline in the Javascript are escaped. This produces this result:</p><div class="code"><div class="codeContent">
|
||||
<pre>onchange=<span class="java-quote">"someFunc(<span class="java-keyword">this</span>.form, 'abc')"</span></pre>
|
||||
</div></div><p class="paragraph"><b class="strong">Why won't the 'if' tag evaluate a one char string?</b>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:<span class="java-keyword">if</span> test=<span class="java-quote">"#myObj.myString == 'A'"</span>> Why doesn't <span class="java-keyword">this</span> work when myString is equal to A? </ww:<span class="java-keyword">if</span>></pre>
|
||||
</div></div></p>OGNL will interpret 'A' as a char type and not a string. Simple solution - flip the double and single quotes.
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:<span class="java-keyword">if</span> test='#myObj.myString == <span class="java-quote">"A"</span>'> This works! </ww:<span class="java-keyword">if</span>></pre>
|
||||
</div></div><p class="paragraph">Alternatively, you can escape the double quotes in the String:</p><div class="code"><div class="codeContent">
|
||||
<pre><ww:<span class="java-keyword">if</span> test=<span class="java-quote">"#myObj.myString == \"</span>A\""> This works! </ww:<span class="java-keyword">if</span>></pre>
|
||||
</div></div><p class="paragraph"><b class="strong">I'm trying to run the webwork example in the tutorial on Tomcat, and it can't instantiate the VelocityEngine</b></p>Tomcat says:<p class="paragraph">javax.servlet.ServletException: Servlet.init() for servlet webwork threw exception at <br/>
|
||||
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:963)<br/>
|
||||
…<br/>
|
||||
root cause</p>java.lang.RuntimeException: Unable to instantiate VelocityEngine!<br/>
|
||||
at <br/>
|
||||
com.opensymphony.webwork.views.velocity.VelocityManager.newVelocityEngine(VelocityManager.java:333)<br/>
|
||||
at <br/>
|
||||
com.opensymphony.webwork.views.velocity.VelocityManager.init(VelocityManager.java:146)<br/>
|
||||
at <br/>
|
||||
com.opensymphony.webwork.dispatcher.ServletDispatcher.init(ServletDispatcher.java:177)<br/>
|
||||
at <br/>
|
||||
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)
|
||||
<p class="paragraph"><em class="emphasis">Solution:</em> <b class="strong">(thanks to Keith Lea)</b></p>It turns out Velocity's Avalon logging system was trying to write to my tomcat folder.<p class="paragraph">So that it's on file somewhere for other people, I will describe the solution:</p>I created a file "velocity.properties" and placed it in my WEB-INF/classes folder. Inside the file I wrote:<p class="paragraph">runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogSystem</p>This stops velocity from logging, and makes webwork work again.
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,71 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : File标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : File标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="Filetag-%26lt%3Bww%3Afile%2F%26gt%3B"> <ww:file /> </a></h3></p>上载文件表单标签.<p class="paragraph"><b class="strong">用法示例</b>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww:file name=<span class="xml-quote">"'uploadedFile'"</span> /></span></pre>
|
||||
</div></div><p class="paragraph"><b class="strong">属性</b>
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th> 名字 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> id </td><td> 否 </td><td> HTML的id属性 </td>
|
||||
</tr><tr>
|
||||
<td> name </td><td> <b class="strong">是</b> </td><td> HTML的name属性 </td>
|
||||
</tr><tr>
|
||||
<td> value </td><td> 否 </td><td> 作为字段值 </td>
|
||||
</tr><tr>
|
||||
<td> label </td><td> 否 </td><td> 用于模版中的标签文字 </td>
|
||||
</tr><tr>
|
||||
<td> labelposition </td><td> 否 </td><td> 标签的对齐方式 (left,right,center) </td>
|
||||
</tr><tr>
|
||||
<td> required </td><td> 否 </td><td> 在表单提交时是否是必需字段 </td>
|
||||
</tr><tr>
|
||||
<td> accept </td><td> 否 </td><td> HTML的accept属性: 列出接受的文件类型 </td>
|
||||
</tr><tr>
|
||||
<td> onchange </td><td> 否 </td><td> HTML的onchange属性 </td>
|
||||
</tr><tr>
|
||||
<td> onclick </td><td> 否 </td><td> HTML的onclick属性 </td>
|
||||
</tr><tr>
|
||||
<td> cssClass </td><td> 否 </td><td> HTML的class属性 </td>
|
||||
</tr><tr>
|
||||
<td> cssStyle </td><td> 否 </td><td> HTML的style属性 </td>
|
||||
</tr><tr>
|
||||
<td> theme </td><td> 否 </td><td> 使用的主题 </td>
|
||||
</tr><tr>
|
||||
<td> template </td><td> 否 </td><td> 使用的模版名 </td>
|
||||
</tr>
|
||||
</table></p>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,76 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Form标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Form标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="Formtag-%26lt%3Bww%3Aform%2F%26gt%3B"> <ww:form /> </a></h3></p>一个HTML表单. <p class="paragraph"><b class="strong">用法示例</b>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww:form name=<span class="xml-quote">"'myForm'"</span> action=<span class="xml-quote">"'submit.action'"</span>></span> ... <span class="xml-tag"></ww:form></span></pre>
|
||||
</div></div></p><div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww:form name=<span class="xml-quote">"'myForm'"</span> action=<span class="xml-quote">"'submit'"</span> namespace=<span class="xml-quote">"'/foo'"</span>></span> ... <span class="xml-tag"></ww:form></span></pre>
|
||||
</div></div><p class="paragraph"><b class="strong">属性</b>
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th> 名字 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> name </td><td> <b class="strong">是</b> </td><td> HTML的name属性 </td>
|
||||
</tr><tr>
|
||||
<td> value </td><td> 否 </td><td> 作为字段值 </td>
|
||||
</tr><tr>
|
||||
<td> openTemplate </td><td> 否 </td><td> 用于标签开始的模版 </td>
|
||||
</tr><tr>
|
||||
<td> action </td><td> 是 </td><td> HTML的action属性 </td>
|
||||
</tr><tr>
|
||||
<td> namespace </td><td> 否 </td><td> 活动的名空间</td>
|
||||
</tr><tr>
|
||||
<td> target </td><td> 否 </td><td> HTML的target属性 </td>
|
||||
</tr><tr>
|
||||
<td> method </td><td> 否 </td><td> 'GET'或'POST' </td>
|
||||
</tr><tr>
|
||||
<td> enctype </td><td> 否 </td><td> HTML的enctype属性 </td>
|
||||
</tr><tr>
|
||||
<td> validate </td><td> 否 </td><td> 是否使用客户段校验 </td>
|
||||
</tr><tr>
|
||||
<td> cssClass </td><td> 否 </td><td> HTML的class属性 </td>
|
||||
</tr><tr>
|
||||
<td> cssStyle </td><td> 否 </td><td> HTML的style属性 </td>
|
||||
</tr><tr>
|
||||
<td> theme </td><td> 否 </td><td> 使用的主题 </td>
|
||||
</tr><tr>
|
||||
<td> template </td><td> 否 </td><td> 用于标签结束的模版名 </td>
|
||||
</tr>
|
||||
</table></p>
|
||||
<br/>
|
||||
<b class="strong">注意</b>: <b class="strong">action</b>属性有两种工作方式. 第一个例子中展示的是最初的(也是被废弃的)格式. 新格式允许仅使用定义在xwork.xml中的活动名称(如果有名空间, 还要加上名空间). 如果需要<a href="Client-Side Validation.html" title="Client-Side Validation">客户段校验</a>的话, 这是<b class="strong">必需的</b><br/>
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,56 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : FreeMarker Result</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : FreeMarker Result
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">cameronbraid</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h4 style="margin: 4px 0px 4px 0px;" class="heading4"><a name="FreeMarkerResult-FreeMarker"> FreeMarker </a></h4>
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>Parameters </th><th> Required </th><th> Description </th>
|
||||
</tr><tr>
|
||||
<td> location </td><td> <b class="strong">yes</b></td><td> the <a href="#FreeMarkerResult-locationofthetemplate" title="location of the template on FreeMarker Result">location of the template</a> to process </td>
|
||||
</tr><tr>
|
||||
<td> parse </td><td> no </td><td> true by default. If set to false, the location param will not be parsed for Ognl expressions </td>
|
||||
</tr><tr>
|
||||
<td> contentType </td><td> no </td><td> defaults to "text/html" unless specified </td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"freemarker"</span>></span>foo.ftl<span class="xml-tag"></result></span></pre>
|
||||
</div></div></p><a name="FreeMarkerResult-locationofthetemplate"></a>
|
||||
<h4 class="heading4"><a name="FreeMarkerResult-LocationoftheTemplate"> Location of the Template</a></h4>
|
||||
The FreemarkarManager class configures the template loaders so that the template location can be either
|
||||
<ul class="star">
|
||||
<li> relative to the web root folder. eg /WEB-INF/views/home.ftl</li>
|
||||
<li> a classpath resuorce. eg com/company/web/views/home.ftl</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,69 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 开始WebWork之旅</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 开始WebWork之旅
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
本页由<font color="#0050B2">casey</font>最后修改于2004年9月10日.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">本站点内容适合于已经理解了相关技术的有经验的开发者. 在开始深入了解Webwork如何工作并运行演示程序之前, 推荐您重新审视下列概念:
|
||||
<ul type="square" class="minus">
|
||||
<li> Java</li>
|
||||
<li> Servlets, JSP, and Tag Libraries</li>
|
||||
<li> JavaBeans</li>
|
||||
<li> HTML and HTTP</li>
|
||||
<li> Web Containers (ex. Tomcat)</li>
|
||||
<li> XML</li>
|
||||
</ul>
|
||||
<h4 class="heading4"><a name="GettingStarted-Website%26amp%3Bdownloads%3Caname%3D%22GettingStartedWebsite%2526amp%253Bdownloads%22%3E%3C%2Fa%3E"> 站点及下载 <a name="GettingStarted-Website%26amp%3Bdownloads"></a></a></h4></p>本站点提供多中下载内容. 参见下列链接:<br/>
|
||||
|
||||
<ul type="square" class="minus">
|
||||
<li> <a href="https://webwork.dev.java.net/servlets/ProjectDocumentList" title="Visit page outside Confluence">下载Webwork</a> - 下在WebWork发布包</li>
|
||||
<li> <a href="http://www.opensymphony.com/contact.jsp" title="Visit page outside Confluence">Webwork邮件列表</a> - <a href="https://webwork.dev.java.net/servlets/SummarizeList?listName=dev" title="Visit page outside Confluence">浏览邮件存档</a>或者<a href="mailto:dev@webwork.dev.java.net" title="Send mail to post a question">张贴问题</a>. 该列表全部由积极的开发者, 代码捐献者以及重要用户组成. 这也是得到问题答案的最好的, 最快的方法.</li>
|
||||
<li> <a href="https://webwork.dev.java.net/source/browse/webwork" title="Visit page outside Confluence">CVS</a> - 浏览CVS和java.net网站的代码</li>
|
||||
<li> <a href="http://wiki.opensymphony.com/display/WW/WebWork" title="Visit page outside Confluence">Webwork Wiki</a> - Powered by <a href="http://www.atlassian.com/software/confluence/default.jsp?clicked=footer" title="Visit page outside Confluence">Confluence</a>, the professional J2EE wiki</li>
|
||||
<li> <a href="http://jira.opensymphony.com/secure/BrowseProject.jspa?id=10030" title="Visit page outside Confluence">Webwork的Bug和问题</a> - Powered by <a href="http://www.atlassian.com/software/jira" title="Visit page outside Confluence">JIRA:Bug & Issue Traking System</a></li>
|
||||
<li> <a href="http://www.opensymphony.com" title="Visit page outside Confluence">OpenSymphony主页</a></li>
|
||||
</ul>
|
||||
<h4 class="heading4"><a name="GettingStarted-What%26%23039%3Bsincludedinthedistro%3Caname%3D%22GettingStartedincludedindistro%22%3E%3C%2Fa%3E"> 发行包包含的内容 <a name="GettingStarted-includedindistro"></a></a></h4><p class="paragraph">发行包包含下列目录结构:</p><div class="preformatted"><div class="preformattedContent">
|
||||
<pre>docs/ lib/ src/ src/java/template/ webwork-(VERSION).jar webwork-example.war webwork-migration.jar</pre>
|
||||
</div></div><p class="paragraph">docs目录包含当前版本的Javadoc, 您正在阅读的文档, 以及Junit的构建报告. lib目录包含WebWork必需的以及可选用的支持包:</p><div class="preformatted"><div class="preformattedContent">
|
||||
<pre>lib/ core/ migration/ optional/</pre>
|
||||
</div></div><p class="paragraph">注意: 没有一个可选包是WebWork运行时必须使用的. 如果你希望使用某些特性如JasperReport或FreeMarker结果类型, 就必须包含可选包.</p>Webwork也将全部的源文件和JSP标签模版打包在其中.<p class="paragraph"><h4 class="heading4"><a name="GettingStarted-Installing%3Caname%3D%22GettingStartedInstalling%22%3E%3C%2Fa%3E"> 安装 <a name="GettingStarted-Installing"></a></a></h4></p>下文介绍如何设置你的Web应用. 复制webwork-(VERSION).jar, /lib/core目录中全部的*.jar 文件以及/lib/optional目录中需要的*.jar文件到你的webapp/lib目录中. 如果你需要定制你自己的模版(用于描述如何使用webwork UI标签绘制HTML), 将/src/java/template目录复制到你的webapp/目录中. 你的Web应用看起来可能像这样:<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>/mywebapp/ /mywebapp/template/ /mywebapp/META-INF/ /mywebapp/WEB-INF/ /mywebapp/WEB-INF/classes/ /mywebapp/WEB-INF/lib/ /mywebapp/WEB-INF/lib/CORE&OPTIONAL *.jar /mywebapp/WEB-INF/web.xml</pre>
|
||||
</div></div><p class="paragraph"> 你可以直接前进到<a href="Documentation.html#Documentation-Configuration" title="Configuration on Documentation">配置</a>或<a href="Documentation.html#Documentation-Tutorial" title="Tutorial on Documentation">Webwork指南</a></p><h4 class="heading4"><a name="GettingStarted-Runningdemos%3Caname%3D%22GettingStartedRunningdemos%22%3E%3C%2Fa%3E"> 运行演示程序<a name="GettingStarted-Runningdemos"></a></a></h4><p class="paragraph">为了运行webwork应用和演示程序, 你需要一个servlet/jsp引擎. 如果没有, 建议你了解一下<a href="http://jakarta.apache.org/tomcat/" title="Visit page outside Confluence">Apache Tomcat</a>, 这是一个由Apache Jakarta项目开发的免费的Servlet容器, 也可以使用<a href="http://www.caucho.com/" title="Visit page outside Confluence">Caucho Technology</a>的Resin, 它可以免费用于非商业用途. 当你的Servlet容器设置完毕后, 就可以安装webwork示例应用(*.war)和其他任何演示程序了, 只需将.war文件放置在容器的webapp目录下即可. Tomcat的目录位置如下:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><TOMCAT_HOME>/webapps/webwork-example.war</pre>
|
||||
</div></div><br/>
|
||||
当war文件放置在正确的位置后, 启动web容器并通过Web浏览器访问下面的URL.</p><b class="strong">http://</b><cite class="citation">HOST:PORT</cite><b class="strong">/webwork-example</b><br/>
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,44 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 全局结果</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 全局结果
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 13, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">全局结果允许定义一个结果映射, 它可以作为全部活动的缺省结果, 并自动被本包及所有扩展包中的活动继承. 换言之, 如果你想为多个活动指定同一个结果, 就可以把它定义为全局结果.
|
||||
<h5 class="heading5"><a name="Globalresults-globalresultsexample"> 示例</a></h5>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><package name=<span class="xml-quote">"default"</span>></span> .... <span class="xml-tag"><global-results></span> <span class="xml-tag"><result name=<span class="xml-quote">"login"</span> type=<span class="xml-quote">"dispatcher"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"location"</span>></span>login.jsp<span class="xml-tag"></param></span> <span class="xml-tag"></result></span> <span class="xml-tag"></global-results></span> <span class="xml-tag"><action name=<span class="xml-quote">"foo"</span> class=<span class="xml-quote">"mypackage.fooAction"</span>></span> <span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"dispatcher"</span>></span>bar.jsp<span class="xml-tag"></result></span> <span class="xml-tag"></action></span> <span class="xml-tag"><action name=<span class="xml-quote">"submitForm"</span> class=<span class="xml-quote">"mypackage.submitFormAction"</span>></span> <span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"dispatcher"</span>></span>submitSuccess.jsp<span class="xml-tag"></result></span> <span class="xml-tag"></action></span> ... <span class="xml-tag"></package></span></pre>
|
||||
</div></div><br/>
|
||||
等同于
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><package name=<span class="xml-quote">"default"</span>></span> .... <span class="xml-tag"><action name=<span class="xml-quote">"foo"</span> class=<span class="xml-quote">"mypackage.fooAction"</span>></span> <span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"dispatcher"</span>></span>bar.jsp<span class="xml-tag"></result></span> <span class="xml-tag"><result name=<span class="xml-quote">"login"</span> type=<span class="xml-quote">"dispatcher"</span>></span>login.jsp<span class="xml-tag"></result></span> <span class="xml-tag"></action></span> <span class="xml-tag"><action name=<span class="xml-quote">"submitForm"</span> class=<span class="xml-quote">"mypackage.submitFormAction"</span>></span> <span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"dispatcher"</span>></span>submitSuccess.jsp<span class="xml-tag"></result></span> <span class="xml-tag"><result name=<span class="xml-quote">"login"</span> type=<span class="xml-quote">"dispatcher"</span>></span>login.jsp<span class="xml-tag"></result></span> <span class="xml-tag"></action></span> ... <span class="xml-tag"></package></span></pre>
|
||||
</div></div></p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Hibernate</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Hibernate
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Jun 18, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">在WebWork中使用Hibernate何在其他Web框架中没什么不同. 只需要按照<a href="http://www.hibernate.org/5.html" title="Visit page outside Confluence">http://www.hibernate.org/5.html</a>的描述配置Hibernate. 但是, 有几个已经在下列项目中成功应用的优秀模式:</p><ul class="star">
|
||||
<li> AdminApp <a href="http://www.hibernate.org/159.html#a5" title="Visit page outside Confluence">http://www.hibernate.org/159.html#a5</a></li>
|
||||
<li> Petsoar <a href="http://www.wiley.com/legacy/compbooks/walnes" title="Visit page outside Confluence">http://www.wiley.com/legacy/compbooks/walnes</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,59 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Hidden标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Hidden标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="Hiddentag-%26lt%3Bww%3Ahidden%2F%26gt%3B"> <ww:hidden /></a></h3></p>一个类型为"hidden"的INPUT标签.<p class="paragraph"><b class="strong">用法示例</b>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww:hidden name=<span class="xml-quote">"'someName'"</span> value=<span class="xml-quote">"value"</span>/></span></pre>
|
||||
</div></div><p class="paragraph"><b class="strong">属性</b>
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th> 名字 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> id </td><td> 否 </td><td> HTML的id属性 </td>
|
||||
</tr><tr>
|
||||
<td> name </td><td> <b class="strong">是</b> </td><td> HTML的name属性 </td>
|
||||
</tr><tr>
|
||||
<td> value </td><td> 否 </td><td> 作为字段值 </td>
|
||||
</tr><tr>
|
||||
<td> cssClass </td><td> 否 </td><td> HTML的class属性 </td>
|
||||
</tr><tr>
|
||||
<td> cssStyle </td><td> 否 </td><td> HTML的style属性 </td>
|
||||
</tr><tr>
|
||||
<td> theme </td><td> 否 </td><td> 使用的主题 </td>
|
||||
</tr><tr>
|
||||
<td> template </td><td> 否 </td><td> 使用的模版名 </td>
|
||||
</tr>
|
||||
</table></p>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : How do I populate a form bean and get the value using the taglib</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : How do I populate a form bean and get the value using the taglib
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 30, 2004 by <font color="#0050B2">jcarreira</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">First off, if you're coming from Struts, you may feel more comfortable using FormBeans instead of using the Action as your form bean. Be aware, though, that in Webwork you DO have the option of having the properties directly in the Action class. If you want to use a FormBean, here's an example:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="java-keyword">public</span> class TestAction <span class="java-keyword">extends</span> ActionSupport { <span class="java-keyword">private</span> TestBean myBean; <span class="java-keyword">public</span> TestBean getMyBean() { <span class="java-keyword">return</span> myBean; } <span class="java-keyword">public</span> void setMyBean(TestBean myBean) { <span class="java-keyword">this</span>.myBean = myBean; } <span class="java-keyword">protected</span> <span class="java-object">String</span> doExecute() <span class="java-keyword">throws</span> Exception { myBean = <span class="java-keyword">new</span> TestBean(); BeanUtil.setProperties(ActionContext.getContext().getParameters(), myBean); <span class="java-keyword">return</span> SUCCESS; } }</pre>
|
||||
</div></div></p>Then, in your success.jsp, which is mapped as the success result of TestAction in the views.properties or actions.xml (see the docs for how to configure actions and view mappings), you can do this:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><!-- This will call getMyBean() on your action and put it on the top of the value stack -> <webwork:property value=<span class="java-quote">"myBean"</span>> <!- This will call getName() on your TestBean and print it to the page --> The name is: <webwork:property value=<span class="java-quote">"name"</span>/> </webwork:property></pre>
|
||||
</div></div><br/>
|
||||
This is a good way to do it if you have several parameters from the TestBean that you want to display, but, if you have just one, like in this case, it's probably better to do this:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><webwork:property value=<span class="java-quote">"myBean/name"</span>/></pre>
|
||||
</div></div><br/>
|
||||
Which will call getMyBean.getName() and print that out to the page.
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,51 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : HttpHeader Result</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : HttpHeader Result
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 13, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h4 style="margin: 4px 0px 4px 0px;" class="heading4"><a name="HttpHeaderResult-HttpHeader"> HttpHeader </a></h4>
|
||||
使用值栈定义HTTP头信息.</p><table class="wikitable">
|
||||
<tr>
|
||||
<th>参数 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> status </td><td> 否 </td><td> HTTP响应的状态码 </td>
|
||||
</tr><tr>
|
||||
<td> parse </td><td> 否 </td><td> 缺省为true. 如果设为false, location参数将不作为Ognl表达式进行解析 </td>
|
||||
</tr><tr>
|
||||
<td> headers</td><td> 否 </td><td> 头信息的值</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
Example:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"header"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"status"</span>></span>204<span class="xml-tag"></param></span> <span class="xml-tag"><param name=<span class="xml-quote">"headers.a"</span>></span>a custom header value<span class="xml-tag"></param></span> <span class="xml-tag"><param name=<span class="xml-quote">"headers.b"</span>></span>another custom header value<span class="xml-tag"></param></span> <span class="xml-tag"></result></span></pre>
|
||||
</div></div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,46 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : I18n标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : I18n标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="I18ntag-%26lt%3Bww%3Ai18n%2F%26gt%3B"> <ww:i18n /> </a></h3></p>将资源包放入值栈, 以便text标签使用.<p class="paragraph"><b class="strong">属性</b>
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th> 名字 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> name </td><td> 是 </td><td> 资源包的名字 </td>
|
||||
</tr>
|
||||
</table>
|
||||
<br/>
|
||||
<b class="strong">用法示例</b><br/>
|
||||
-参见 <a href="Text tag.html" title="Text tag">Text标签</a></p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,45 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Interceptor Order</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Interceptor Order
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 30, 2004 by <font color="#0050B2">jcarreira</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">Interceptors provide an excellent means to wrap before/after processing. The concept reduces code duplication (think AOP).</p>Order of interceptors…<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><interceptor-stack name=<span class="java-quote">"xaStack"</span>> <interceptor-ref name=<span class="java-quote">"thisWillRunFirstInterceptor"</span>/> <interceptor-ref name=<span class="java-quote">"thisWillRunNextInterceptor"</span>/> <interceptor-ref name=<span class="java-quote">"followedByThisInterceptor"</span>/> <interceptor-ref name=<span class="java-quote">"thisWillRunLastInterceptor"</span>/> </interceptor-stack></pre>
|
||||
</div></div>
|
||||
<p class="paragraph">Note that some interceptors will interrupt the stack/chain/flow… so the order is very important.</p>Iterceptors implementing com.opensymphony.xwork.interceptor.PreResultListener will run after the Action executes its action method but before the Result executes<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>thisWillRunFirstInterceptor thisWillRunNextInterceptor followedByThisInterceptor thisWillRunLastInterceptor MyAction1 MyAction2 (chain) MyPreResultListener MyResult (result) thisWillRunLastInterceptor followedByThisInterceptor thisWillRunNextInterceptor thisWillRunFirstInterceptor</pre>
|
||||
</div></div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,84 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 截取器</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 截取器
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="Interceptors-Overview"> 综述</a></h2></p>截取器可以动态截取活动调用. 它为开发者提供了在活动执行前后执行其他代码的机会. 它也能阻止活动执行. 截取器还为开发者提供了可重用的方式来封装公共功能并将它应用到一个或多个活动中. 更多信息参见<a href="http://wiki.opensymphony.com//display/XW/Interceptors" title="Interceptors">XWork: 截取器</a>. Below describes built in Webwork interceptors.<p class="paragraph"><h3 class="heading3"><a name="Interceptors-Webwork%26amp%3BXWorkInterceptors"> Webwork与XWork的截取器</a></h3></p>截取器类也能用xwork配置文件指定的名值对(key-value pair)进行定义. 下列名字定义在<a href="webwork-default.xml.html" title="webwork-default.xml">webwork-default.xml</a>文件中. 如果你扩展了webwork-default包, 你就可以使用下列名字. 否则必须在<interceptors>元素中使用名字和类名定义.<br/>
|
||||
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>名字</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>timer</td><td>输出活动(包含嵌套的截取器和视图)执行时间</td>
|
||||
</tr><tr>
|
||||
<td>logger</td><td>输出活动的名字</td>
|
||||
</tr><tr>
|
||||
<td>chain</td><td>使得前一个活动的属性在当前活动中可用. 通常与<result type="chain">元素(在前一个活动定义中)一起使用. 更多内容参阅<a href="Chaining Interceptor.html" title="Chaining Interceptor">链接截取器</a></td>
|
||||
</tr><tr>
|
||||
<td>static-params</td><td>把xwork.xml中定义的参数设置到活动中. 相当于包含在<action />标签中的<param />标签.</td>
|
||||
</tr><tr>
|
||||
<td>params</td><td>将请求的参数设置到活动类中.</td>
|
||||
</tr><tr>
|
||||
<td>model-driven</td><td>如果活动实现ModelDriven, 将getModel()的结果压入值栈.</td>
|
||||
</tr><tr>
|
||||
<td>component</td><td>激活注册的组件并允许活动使用. 请参考components.xml</td>
|
||||
</tr><tr>
|
||||
<td>token</td><td>在活动中检查合法令牌(token), 防止表单的重复提交 </td>
|
||||
</tr><tr>
|
||||
<td>token-session</td><td>同上, 但是在接到非法令牌时将提交的数据保存在session中</td>
|
||||
</tr><tr>
|
||||
<td>validation</td><td>使用定义在{Action}-validation.xml中的校验器进行校验</td>
|
||||
</tr><tr>
|
||||
<td>workflow</td><td>调用活动类中的validate方法. 如果活动产生了错误将返回到输入视图.</td>
|
||||
</tr><tr>
|
||||
<td>servlet-config</td><td>提供访问HttpServletRequest和HttpServletResponse的途径(使用前请三思, 因为它使你的代码与Servlet接口绑定在一起)</td>
|
||||
</tr><tr>
|
||||
<td>prepare</td><td>如果活动实现Preparable接口, 调用它的prepare ()方法.</td>
|
||||
</tr><tr>
|
||||
<td>conversionError </td><td> 将ActionContext中的数据转换错误添加到活动的字段错误中 </td>
|
||||
</tr><tr>
|
||||
<td>fileUpload</td><td>简化访问上传文件的截取器. 更多信息请查看javadoc </td>
|
||||
</tr><tr>
|
||||
<td>execAndWait</td><td>在后台执行服务并向用户发送一个中间等待页面. 参见: <a href="ExecuteAndWaitInterceptor.html" title="ExecuteAndWaitInterceptor">ExecuteAndWaitInterceptor</a></td>
|
||||
</tr>
|
||||
</table><p class="paragraph"><h4 class="heading4"><a name="Interceptors-OrderofInterceptorExecution"> 截取器执行顺序</a></h4></p>截取器提供了优异的方式包装前/后处理. 这一概念减少了代码重复 (考虑AOP[<i>面向方面编程</i>]的概念).<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><interceptor-stack name=<span class="java-quote">"xaStack"</span>> <interceptor-ref name=<span class="java-quote">"thisWillRunFirstInterceptor"</span>/> <interceptor-ref name=<span class="java-quote">"thisWillRunNextInterceptor"</span>/> <interceptor-ref name=<span class="java-quote">"followedByThisInterceptor"</span>/> <interceptor-ref name=<span class="java-quote">"thisWillRunLastInterceptor"</span>/> </interceptor-stack></pre>
|
||||
</div></div>
|
||||
<p class="paragraph">注意: 某些截取器会中断栈/链/流程, 因此顺序十分重要.</p>实现com.opensymphony.xwork.interceptor.PreResultListener接口的截取器将在活动执行之后, 结果执行之前执行. <br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>thisWillRunFirstInterceptor thisWillRunNextInterceptor followedByThisInterceptor thisWillRunLastInterceptor MyAction1 MyAction2 (chain) MyPreResultListener MyResult (result) thisWillRunLastInterceptor followedByThisInterceptor thisWillRunNextInterceptor thisWillRunFirstInterceptor</pre>
|
||||
</div></div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,60 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 国际化</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 国际化
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">WebWork在两种地方支持国际化(简写为i18n): UI标签和活动/字段错误信息.</p><ul type="square" class="minus">
|
||||
<li> <a href="UI Tags.html" title="UI Tags">UI标签</a></li>
|
||||
<li> <a href="Validation Examples.html" title="Validation Examples">校验示例</a></li>
|
||||
</ul><br/>
|
||||
按照下列顺序搜索资源包:<br/>
|
||||
|
||||
<ul class="star">
|
||||
<li> ActionClass.properties</li>
|
||||
<li> BaseClass.properties (直到Object.properties)</li>
|
||||
<li> Interface.properties (每个接口和父接口)</li>
|
||||
<li> package.properties (每一个基类的包, 直到java/lang/package.properties)</li>
|
||||
</ul><br/>
|
||||
要显示i18n文本, 可以在property标签或其他任何UI标签(用作UI标签的label时特别有用)中调用getText():<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww:property value=<span class="xml-quote">"getText('some.key')"</span>/></span></pre>
|
||||
</div></div><p class="paragraph">也可以使用text标签:</p><div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww:text name=<span class="xml-quote">"'some.key'"</span>/></span></pre>
|
||||
</div></div><p class="paragraph">注意还有一个i18n标签, 它将资源包压入栈中, 允许使用除前面提到的继承链以外的资源包显示文本.</p><div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww:i18n name=<span class="xml-quote">"some/package/bundle"</span>></span> <span class="xml-tag"><ww:text name=<span class="xml-quote">"'some.key'"</span>/></span> <span class="xml-tag"></ww:i18n></span></pre>
|
||||
</div></div><br/>
|
||||
|
||||
<div align='center'><div class='informationMacroPadding'><table cellpadding='5' width='85%' cellspacing='0' class='warningMacro' border='0'><tr><td width='16' valign='top'><img src="/images/icons/emoticons/forbidden.png" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>
|
||||
在SiteMesh修饰器中也可以使用国际化, 但有几个小问题. 参阅<a href="SiteMesh.html" title="SiteMesh">SiteMesh</a>页面了解WebWork如何与SiteMesh集成, 包括集成提示.
|
||||
</td></tr></table></div></div><p class="paragraph"><h2 class="heading2"><a name="Internationalization-Usingamasterapplicationcatalog"> 使用主应用目录</a></h2></p>Struts用户应该比较熟悉application.properties资源包, 你可以把应用中需要翻译的全部消息都放在里面. 然而WebWork2将资源包分散在每个活动或模型类中, 这些资源包可能包含重复消息. 对此简单的修正方法是在类路径的目录com/opensymphony/xwork中创建文件ActionSupport.properties. 这仅在全部活动类继承ActionSupport的情况下工作.<p class="paragraph">也可以通过设置<a href="webwork.properties.html" title="webwork.properties">webwork.properties</a>中的<b class="strong">webwork.custom.i18n.resources</b>来使用全局资源包.</p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,41 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 反转控制</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 反转控制
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Jun 18, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">反转控制是一种处理对象依赖的方法. 在WebWork中, 对象使用"组件(component)"管理依赖关系. 关于反转控制的综述(现在也称作Dependency Injection), 请阅读Martin Fowler关于IoC的文档<a href="http://www.martinfowler.com/articles/injection.html." title="Visit page outside Confluence">http://www.martinfowler.com/articles/injection.html.</a> 除了WebWork的IoC容器, 还有许多其他容器可以使用, 包括<a href="Spring.html" title="Spring">Spring</a>和<a href="Pico.html" title="Pico">Pico</a>.</p><ul class="star">
|
||||
<li> <a href="IoC Overview.html" title="IoC Overview">IoC综述</a></li>
|
||||
<li> <a href="Xwork's Component Architecture.html" title="Xwork's Component Architecture">Xwork组件架构</a></li>
|
||||
<li> <a href="Components.html" title="Components">Webwork如何使用组件</a></li>
|
||||
<li> <a href="IoC Configuration.html" title="IoC Configuration">在Webwork和XWork中配置组件</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,52 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : IoC配置</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : IoC配置
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 13, 2004 by <font color="#0050B2">mcampbell</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="IoCConfiguration-Configurationweb.xml">配置 - web.xml</a></h2></p>为配置WebWork的组件管理, 必须在web.xml的适当位置加入下列内容:<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><filter></span> <span class="xml-tag"><filter-name></span>container<span class="xml-tag"></filter-name></span> <span class="xml-tag"><filter-class></span>com.opensymphony.webwork.lifecycle.RequestLifecycleFilter<span class="xml-tag"></filter-class></span> <span class="xml-tag"></filter></span> <span class="xml-tag"><filter-mapping></span> <span class="xml-tag"><filter-name></span>container<span class="xml-tag"></filter-name></span> <span class="xml-tag"><url-pattern></span>*.action<span class="xml-tag"></url-pattern></span> <span class="xml-tag"><span class="xml-comment"><!-- modify appropriately --></span></span> <span class="xml-tag"></filter-mapping></span> <span class="xml-tag"><span class="xml-comment"><!-- 你也可以选择将filter对应到任一URI而不仅是*.action. --></span></span> <span class="xml-tag"><span class="xml-comment"><!--下面这种情况就需要这么做: --></span></span> <span class="xml-tag"><span class="xml-comment"><!-- * 在接到请求后直接调用JSP(因为仅使用了*.action) --></span></span> <span class="xml-tag"><span class="xml-comment"><!-- * JSP中包含一个活动并通过ww:action标签运行--></span></span> <span class="xml-tag"><span class="xml-comment"><!-- * 活动实现了一些enabler接口一获取组件为其服务 --></span></span> <span class="xml-tag"><span class="xml-comment"><!-- 这样做的理由: (Per Patrick Lightbody) --></span></span> <span class="xml-tag"><span class="xml-comment"><!-- <span class="xml-quote">"组件通过在request的属性中查找ComponentManager进行工作. --></span></span> <span class="xml-tag"><span class="xml-comment"><!-- 它通过filter发生作用. 如果在整个过程中没有一个#42;.action, --></span></span> <span class="xml-tag"><span class="xml-comment"><!-- filter不会起作用, 组件也绝不会工作." --></span></span> <span class="xml-tag"><span class="xml-comment"><!-- 这么做的代价很小, 因此不要过度担心 --></span></span> <span class="xml-tag"><span class="xml-comment"><!-- 这样做的性能. --></span></span> <span class="xml-tag"><span class="xml-comment"><!-- <filter-mapping></span> --></span> <span class="xml-tag"><span class="xml-comment"><!-- <filter-name></span>container<span class="xml-tag"></filter-name></span> --></span> <span class="xml-tag"><span class="xml-comment"><!-- <url-pattern></span>*<span class="xml-tag"></url-pattern></span> --></span> <span class="xml-tag"><span class="xml-comment"><!-- </filter-mapping></span> --></span> <span class="xml-tag"><listener></span> <span class="xml-tag"><listener-class></span>com.opensymphony.webwork.lifecycle.SessionLifecycleListener<span class="xml-tag"></listener-class></span> <span class="xml-tag"></listener></span> <span class="xml-tag"><listener></span> <span class="xml-tag"><listener-class></span>com.opensymphony.webwork.lifecycle.ApplicationLifecycleListener<span class="xml-tag"></listener-class></span> <span class="xml-tag"></listener></span></pre>
|
||||
</div></div><p class="paragraph">这些设置允许WebWork在application, session和request范围中管理组件. 注意即使你的应用中不使用全部scope, 上述三个scope也必须在web.xml中指定, 这样WebWork的组件管理才能正确工作.</p><h2 class="heading2"><a name="IoCConfiguration-Configurationxwork.xml">配置 - xwork.xml</a></h2><p class="paragraph">ComponentInterceptor用于对XWork的活动进行反转控制(也就是说, 为活动提供组件). ComponentInterceptor应当声明在xwork.xml的<interceptors>部分:</p><div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><interceptor name=<span class="xml-quote">"component"</span> class=<span class="xml-quote">"com.opensymphony.xwork.interceptor.component.ComponentInterceptor"</span>/></span></pre>
|
||||
</div></div><p class="paragraph">应当确保所有需要组件的活动都应用了这个截取器. (关于如何将截取器应用到活动上, 参见OS:XWork Interceptors.)<br/>
|
||||
如果你向对活动和组件之外的对象使用反转控制, 你需要直接使用ComponentManager.</p>还需要注意, ComponentInterceptor是WebWork的缺省截取器栈的一部分. 因此, 如果活动使用了defaultStack, 就已经包括了ComponentInterceptor.<p class="paragraph"><h2 class="heading2"><a name="IoCConfiguration-Configurationcomponents.xml">配置 - components.xml</a></h2></p>文件components.xml用于定义可用组件. 这里指定的组件将被加载到XWork的ComponentManager可以被任何活动使用. components.xml必须放在根类路径中(也就是WEB-INF/classes目录).<br/>
|
||||
这里有一个components.xml样例, 它配置了一个Counter组件. Counter将生存在session对象中, 将被传递到任何实现CounterAware接口的活动中:<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><components></span> <span class="xml-tag"><component></span> <span class="xml-tag"><scope></span>session<span class="xml-tag"></scope></span> <span class="xml-tag"><class></span>com.opensymphony.webwork.example.counter.Counter<span class="xml-tag"></class></span> <span class="xml-tag"><enabler></span>com.opensymphony.webwork.example.counter.CounterAware<span class="xml-tag"></enabler></span> <span class="xml-tag"></component></span> <span class="xml-tag"></components></span></pre>
|
||||
</div></div><p class="paragraph">每一个组件元素必需包含下列属性:</p><ul class="star">
|
||||
<li> <em class="emphasis">scope</em>: 有效值为<em class="emphasis">application</em>, <em class="emphasis">session</em>和<em class="emphasis">request</em>. 它决定组件的生存时间. Application组件在应用启动时创建, 将在整个应用的生存期间一直存在. Session组件存在于一个用户会话过程中, request组件仅存在于一个客户请求期间.</li>
|
||||
<li> <em class="emphasis">class</em>: 组件的类名. 该对象的一个实例将存在于scope指定的周期中, 可以用于任何活动(或其他代码). 注意组件时延迟加载(lazy-loaded)的, 因此如果没有对象使用该组件, 它将不会真正被实例化. 该组件必须有一个无参构造函数.</li>
|
||||
<li> <em class="emphasis">enabler</em>: 任何实现或集成该类(或接口)的活动都将被设置该组件.</li>
|
||||
</ul><p class="paragraph">注意虽然组件可以依赖于其他组件, 但不能依赖于更小范围的组件. 因此, 一个session范围的组件不能依赖于一个请求范围的组件. 因此, 一个session范围的组件不能依赖于一个请求范围的组件.</p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,60 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : IoC综述</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : IoC综述
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Jun 18, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="IoCOverview-Overview"> 综述</a></h2></p>在许多应用中, 都有一些对象必需使用组件对象. 简单来说, IoC模式允许父对象(在Webwork和XWork中是ComponentManager实例)向需要的活动对象提供资源对象(通常是一个活动, 但也可以是任何实现适当的<em class="emphasis">enabler</em>接口的对象), 而不是需要对象自己获取资源.<p class="paragraph">有两种方式实现IoC: 初始化或使用enabler接口. 使用初始化方式, 给定活动对象使用资源对象作为构造函数的参数完成初始化. 使用enabler接口, 活动将具有接口的方法"setComponent(ComponentObject r);", 该方法允许在活动对象初始化后将资源对象传递到该对象. 根据对象实现的接口传递对应的组件对象. XWork使用<em class="emphasis">enablers</em>传递组件.</p><h2 class="heading2"><a name="IoCOverview-WhyIoC%3F"> 为什么使用IoC?</a></h2><p class="paragraph">那么IoC为什么有用呢? 这意味着我们可以采用自顶向下方式开发组件(通常是某类服务[<i>, 如JDBC连接, 在客户程序中不需要知道连接是Oracle的还是Sybase的, 也不需要知道连接是从连接池获取还是其他方式</i>]), 而不需要构建一个注册类让客户调用它以获取组件实例.</p>实现服务的传统方式可能采用下面类似的步骤:
|
||||
<ol>
|
||||
<li> 编写组件(如ExchangeRateService)</li>
|
||||
<li> 编写客户类(如XWork活动)</li>
|
||||
<li> 编写保存该组件的注册类(如Registry)</li>
|
||||
<li> 编写在注册类中注册指定组件对象的代码 (如Registry.registerService(new MyExchangeRateService()))</li>
|
||||
<li> 在客户类中使用注册类获取服务(如, ExchangeRateService ers = Registry.getExchangeRateService())</li>
|
||||
<li> 在客户类中调用组件对象(如, String baseCurrencyCode = ers.getBaseCurrency())</li>
|
||||
</ol><br/>
|
||||
使用IoC, 该过程简化为:
|
||||
<ol>
|
||||
<li> 编写组件类(如ExchangeRateService)</li>
|
||||
<li> 在XWork中注册组件类(如, componentManager.addEnabler(MyExchangeRateService, ExchangeRateAware))</li>
|
||||
<li> 编写客户类, 并确保实现了enabler接口(如一个实现了ExchangeRateAware接口的XWork活动)</li>
|
||||
<li> 在客户类中直接访问组件实例(如, String baseCurencyCode = ers.getBaseCurrency())</li>
|
||||
</ol><br/>
|
||||
反转控制的更多优点如下:
|
||||
<ol>
|
||||
<li> 可测试能力 - 更容易进行测试: 使用enabler方法向对象传递mock对象, 而不需要创建对象用于获取组件的容器.</li>
|
||||
<li> 组件自描述. 当需要初始化一个组件时, 可以很容易得得知该组件需要那些依赖对象(组件)而不需要查看源代码, 文档或示例.</li>
|
||||
<li> 使用反射(reflection)很容易发现依赖关系. 从图表生成到运行时优化都会带来好处(例如, 可以提前判断满足请求所需的组件并可以异步进行组件准备).</li>
|
||||
<li> 避免使用超大工厂(super-uber-mega-factory)设计模式(应用的全部组件都保存在一个类中, 这直接导致与某些类的紧密绑定而难于'just use that one class').</li>
|
||||
<li> 符合Demeter定律(Law of Demeter). 有人认为这很愚蠢, 但在实践中我发现这样工作的更好. 每个类仅和真正使用它的类耦合(and it should never use too much). 这种方法鼓励每个类承担更少的责任, 从而产生更清晰的设计.</li>
|
||||
<li> 允许与环境(context)隔离并可以绕过. ThreadLocal在web应用中可能很合适[<i>hibernate样例代码中使用TnreafLocal管理session对象, 本文可能是针对这一情况</i>], 但并不一定适合高并发的同步应用(如消息驱动的应用).</li>
|
||||
</ol>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,57 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 迭代标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 迭代标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 30, 2004 by <font color="#0050B2">jcarreira</font>.
|
||||
</div>
|
||||
|
||||
<ul class="star">
|
||||
<li> iterator</li>
|
||||
<li> <em class="emphasis">generator</em></li>
|
||||
<li> <em class="emphasis">append</em></li>
|
||||
<li> <em class="emphasis">subset</em></li>
|
||||
<li> <em class="emphasis">merge</em></li>
|
||||
<li> <em class="emphasis">sort</em></li>
|
||||
</ul><p class="paragraph">Iterator 将在一个值上进行迭代. 迭代值可以是下列类型之一: java.util.Collection, java.util.Iterator, java.util.Enumeration, java.util.Map, 数组.</p>示例:<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:iterator value=<span class="java-quote">"days"</span>> <p>day is: <ww:property/></p> </ww:iterator></pre>
|
||||
</div></div> <p class="paragraph"></p>上面的例子中调用值栈中当前对象的getDays()方法去的迭代值并进行迭代. <ww:property/>标签输出了迭代当前值.<p class="paragraph"></p>下面的例子中使用BeanTag并将它放入ActionContext. Iterator标签从ActionContext中获取对象并调用getDays(). 属性status用来创建一个IteratorStatus对象, 本例中使用它的odd()方法来实改变行颜色:<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:bean name=<span class="java-quote">"com.opensymphony.webwork.example.IteratorExample"</span> id=<span class="java-quote">"it"</span>> <ww:param name=<span class="java-quote">"day"</span> value=<span class="java-quote">"'foo'"</span>/> <ww:param name=<span class="java-quote">"day"</span> value=<span class="java-quote">"'bar'"</span>/> </ww:bean> <table border=<span class="java-quote">"0"</span> cellspacing=<span class="java-quote">"0"</span> cellpadding=<span class="java-quote">"1"</span>> <tr> <th>Days of the week</th> </tr> <ww:iterator value=<span class="java-quote">"#it.days"</span> status=<span class="java-quote">"rowstatus"</span>> <tr> <ww:<span class="java-keyword">if</span> test=<span class="java-quote">"#rowstatus.odd == <span class="java-keyword">true</span>"</span>> <td style=<span class="java-quote">"background: grey"</span>><ww:property/></td> </ww:<span class="java-keyword">if</span>> <ww:<span class="java-keyword">else</span>> <td><ww:property/></td> </ww:<span class="java-keyword">else</span>> </tr> </ww:iterator> </table></pre>
|
||||
</div></div><p class="paragraph">下一个例子进一步演示了status属性的作用, 通过OGNL从活动中取出对象DAO, 使用DAO迭代组和组包含的用户(在一个安全环境中). 方法last()表示当前对象是否是迭代中最后一个对象, 如果不是, 需要使用逗号把用户分开:</p><div class="code"><div class="codeContent">
|
||||
<pre><webwork:iterator value=<span class="java-quote">"groupDao.groups"</span> status=<span class="java-quote">"groupStatus"</span>> <tr class=<span class="java-quote">"<webwork:<span class="java-keyword">if</span> test="</span>#groupStatus.odd == <span class="java-keyword">true</span> <span class="java-quote">">odd</webwork:<span class="java-keyword">if</span>><webwork:<span class="java-keyword">else</span>>even</webwork:<span class="java-keyword">else</span>>"</span>> <td><webwork:property value=<span class="java-quote">"name"</span> /></td> <td><webwork:property value=<span class="java-quote">"description"</span> /></td> <td> <webwork:iterator value=<span class="java-quote">"users"</span> status=<span class="java-quote">"userStatus"</span>> <webwork:property value=<span class="java-quote">"fullName"</span> /><webwork:<span class="java-keyword">if</span> test=<span class="java-quote">"!#userStatus.last"</span>>,</webwork:<span class="java-keyword">if</span>> </webwork:iterator> </td> </tr> </webwork:iterator></pre>
|
||||
</div></div><p class="paragraph">下一个例子迭代一个活动的集合, 并将每个迭代值传递给另一个活动.</p><div class="code"><div class="codeContent">
|
||||
<pre><ww:action name=<span class="java-quote">"entries"</span> id=<span class="java-quote">"entries"</span>/> <ww:iterator value=<span class="java-quote">"#entries.entries"</span> > <ww:property value=<span class="java-quote">"name"</span> /> <ww:property /> <ww:push value=<span class="java-quote">"..."</span>/> <ww:action name=<span class="java-quote">"edit"</span> id=<span class="java-quote">"edit"</span> > <ww:param name=<span class="java-quote">"entry"</span> value=<span class="java-quote">"[0]"</span> /> </ww:action> </ww:iterator></pre>
|
||||
</div></div><p class="paragraph">这里的窍门是使用了操作符'[:0]'. 它获取当前值并传递给活动edit.
|
||||
'[:0]'操作符与<em class="emphasis"><ww:property /></em>的效果一样. (当然, 这个标签不能用在param标签中).<br/>
|
||||
参见OS:WebWork2 EL.</p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,50 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Iterator tag examples</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Iterator tag examples
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 30, 2004 by <font color="#0050B2">jcarreira</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">This follows on from <a href="Iteration Tags.html" title="Iteration Tags">WW:Iteration Tags</a> which you should read first, but beware of references to '[0]' and 'that'; what you really want in WW2 is 'top', as illustrated below. (I finally worked this out from the source code - hopefully this page means you won't have to.)</p><h4 class="heading4"><a name="Iteratortagexamples-Referencingthecurrentvalue"> Referencing the current value</a></h4><p class="paragraph">The simple examples print out values from the list using the property tag, which uses the value at the top of the stack by default:</p><div class="preformatted"><div class="preformattedContent">
|
||||
<pre>Days: <ul> <ww:iterator value="days"> <li><ww:property/> </ww:iterator> </ul></pre>
|
||||
</div></div><p class="paragraph">But if you're doing anything other than print the value, you probably need to refer to it specifically. Do this:</p><div class="preformatted"><div class="preformattedContent">
|
||||
<pre>Most days: <ul> <ww:iterator value="days"> <ww:if test="top != 'Monday'"> <li><ww:property/> </ww:if> </ww:iterator> </ul></pre>
|
||||
</div></div><p class="paragraph"><h4 class="heading4"><a name="Iteratortagexamples-Iteratingoveralistofobjects"> Iterating over a list of objects</a></h4></p><div class="preformatted"><div class="preformattedContent">
|
||||
<pre><ww:iterator value="employees"> <ww:property value="name"/> is the <ww:property value="jobTitle"/><br> </ww:iterator></pre>
|
||||
</div></div><p class="paragraph">For 'name' and 'jobTitle' you could be more explicit and write 'top.name' and 'top.jobTitle', as 'top' refers to the object on the top of the stack. It's not necessary here, but it is in the next example.</p><h4 class="heading4"><a name="Iteratortagexamples-Iteratingoveralistoflists"> Iterating over a list of lists</a></h4>
|
||||
|
||||
<div class="preformatted"><div class="preformattedContent">
|
||||
<pre><table> <ww:iterator value="grid"> <tr> <ww:iterator value="top"> <td><ww:property/></td> </ww:iterator> </tr> </ww:iterator> </table></pre>
|
||||
</div></div><p class="paragraph">The trick here is to use 'top' as the value for the inner iterator. This example probably uses a two-dimensional array, but you can use the pattern for any list of lists.</p><h4 class="heading4"><a name="Iteratortagexamples-Amorecomplexexample"> A more complex example</a></h4><p class="paragraph">In this example, 'countries' is a list of country objects, each of which has a name and a list of cities. Each city has a name.</p><div class="preformatted"><div class="preformattedContent">
|
||||
<pre><ww:iterator value="countries"> <ww:iterator value="cities"> <ww:property value="name"/>, <ww:property value="[1].name"/><br> </ww:iterator> </ww:iterator></pre>
|
||||
</div></div><p class="paragraph">The output looks like</p><div class="preformatted"><div class="preformattedContent">
|
||||
<pre>Wellington, New Zealand Auckland, New Zealand Moscow, Russia Glasgow, Scotland Edinburgh, Scotland Stockholm, Sweden</pre>
|
||||
</div></div><p class="paragraph">Both the country and city objects have a 'name' property. As you'd expect, the reference to 'name' on its own gives you the city name. To access the country name - effectively "hidden" by the city name - we refer to a specific position on the stack: '[1]'. The top of the stack, position 0, contains the current city, pushed on by the inner iterator; position 1 contains the current country, pushed there by the outer iterator.</p>Actually, as Patrick points out in his comment on <a href="Iteration Tags.html" title="Iteration Tags">WW:Iteration Tags</a>, the '[n]' notation refers to a sub-stack beginning at position n, not just the object at position n. Thus '[0]' is the whole stack and '[1]' is everything except the top object. In our example, we could have been more specific about getting the country name and said '[1].top.name'.
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,70 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : JFreeChartResult</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : JFreeChartResult
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 30, 2004 by <font color="#0050B2">jcarreira</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="JFreeChartResult-Intro"> Intro</a></h2>
|
||||
I am rendering a chart to the output stream. Instead of streaming it directly to the response.out, I create a ChartResult, and let webwork do the chaining for me.</p>I generate the chart in one class, and I render it out in another class, effectively decoupling the view from the actions. You can easily render it out to a file or some view other than a web response.out if you wish.
|
||||
<h2 class="heading2"><a name="JFreeChartResult-Configuration"> Configuration</a></h2>
|
||||
xwork.xml - result-types definitions
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><result-types> <result-type name=<span class="java-quote">"chart"</span> class=<span class="java-quote">"myapp.webwork.extensions.ChartResult"</span>/> </result-types></pre>
|
||||
</div></div><br/>
|
||||
xwork.xml - action definitions
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><action name=<span class="java-quote">"viewModerationChart"</span> class=<span class="java-quote">"myapp.webwork.actions.ViewModerationChartAction"</span>> <result name=<span class="java-quote">"success"</span> type=<span class="java-quote">"chart"</span>> <param name=<span class="java-quote">"width"</span>>400</param> <param name=<span class="java-quote">"height"</span>>300</param> </result> </action></pre>
|
||||
</div></div>
|
||||
<h2 class="heading2"><a name="JFreeChartResult-SourceCodes"> Source Codes</a></h2>
|
||||
My result class searches for a "chart" in the ValueStack and renders it out…
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="java-keyword">public</span> class ChartResult <span class="java-keyword">implements</span> Result { <span class="java-keyword">private</span> <span class="java-object">int</span> width; <span class="java-keyword">private</span> <span class="java-object">int</span> height; <span class="java-keyword">public</span> void execute(ActionInvocation invocation) <span class="java-keyword">throws</span> Exception { JFreeChart chart = (JFreeChart) invocation.getStack().findValue(<span class="java-quote">"chart"</span>); HttpServletResponse response = ServletActionContext.getResponse(); OutputStream os = response.getOutputStream(); ChartUtilities.writeChartAsPNG(os, chart, width, height); os.flush(); } <span class="java-keyword">public</span> void setHeight(<span class="java-object">int</span> height) { <span class="java-keyword">this</span>.height = height; } <span class="java-keyword">public</span> void setWidth(<span class="java-object">int</span> width) { <span class="java-keyword">this</span>.width = width; } }</pre>
|
||||
</div></div><p class="paragraph">My action class creates the JFreeChart to render…
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="java-keyword">public</span> class ViewModerationChartAction <span class="java-keyword">extends</span> ActionSupport { <span class="java-keyword">private</span> JFreeChart chart; <span class="java-keyword">public</span> <span class="java-object">String</span> execute() <span class="java-keyword">throws</span> Exception { <span class="java-comment">// chart creation logic...</span> XYSeries dataSeries = <span class="java-keyword">new</span> XYSeries(<span class="java-keyword">null</span>); <span class="java-keyword">for</span> (<span class="java-object">int</span> i = 0; i <= 100; i++) { dataSeries.add(i, RandomUtils.nextInt()); } XYSeriesCollection xyDataset = <span class="java-keyword">new</span> XYSeriesCollection(dataSeries); ValueAxis xAxis = <span class="java-keyword">new</span> NumberAxis(<span class="java-quote">"Raw Marks"</span>); ValueAxis yAxis = <span class="java-keyword">new</span> NumberAxis(<span class="java-quote">"Moderated Marks"</span>); <span class="java-comment">// set my chart variable</span> chart = <span class="java-keyword">new</span> JFreeChart( <span class="java-quote">"Moderation Function"</span>, JFreeChart.DEFAULT_TITLE_FONT, <span class="java-keyword">new</span> XYPlot( xyDataset, xAxis, yAxis, <span class="java-keyword">new</span> StandardXYItemRenderer(StandardXYItemRenderer.LINES)), <span class="java-keyword">false</span>); chart.setBackgroundPaint(java.awt.Color.white); <span class="java-keyword">return</span> <span class="java-keyword">super</span>.SUCCESS; } <span class="java-keyword">public</span> JFreeChart getChart() { <span class="java-keyword">return</span> chart; } }</pre>
|
||||
</div></div>
|
||||
<h2 class="heading2"><a name="JFreeChartResult-Explaination"> Explaination</a></h2>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="java-keyword">public</span> JFreeChart getChart() { <span class="java-keyword">return</span> chart; }</pre>
|
||||
</div></div><br/>
|
||||
makes the chart available on the ValueStack, which the result gets via
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>JFreeChart chart = (JFreeChart) invocation.getStack().findValue(<span class="java-quote">"chart"</span>);</pre>
|
||||
</div></div></p>From what I can deduce, the webwork pulls in the height and width variables from the xwork.xml definitions for that particular action…
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><param name=<span class="java-quote">"width"</span>>400</param> <param name=<span class="java-quote">"height"</span>>300</param></pre>
|
||||
</div></div>
|
||||
<h2 class="heading2"><a name="JFreeChartResult-Suggestionsforthenextdeveloper..."> Suggestions for the next developer...</a></h2>
|
||||
Currently the "chart" property is hardcoded. There should be a better way of transferring data from the Action to the Result, via some externally defined variable or something. <p class="paragraph">As mentioned by John Patterson (mailing list), the Action is still dependant on a JFreeChart Chart class. This can be improved. The seperation between Action and View can be made cleaner. A chart-agonistic List or Array can be used as the data, and the configuration of the chart details (font, axis, etc...) be done via the result properties in the xwork.xml.</p>But hey, the above works for now. Any suggestions are welcome.
|
||||
<h2 class="heading2"><a name="JFreeChartResult-CreatingchartsviaCeWolfdirectlyinVelocitytemplates"> Creating charts via CeWolf directly in Velocity templates</a></h2>
|
||||
See <a href="http://wiki.opensymphony.com//display/WW/CeWolf+charts+using+Velocity+templates" title="CeWolf charts using Velocity templates">WW:CeWolf charts using Velocity templates</a>.
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,59 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : JSP Expression Language Comparison with WebWork 1.x</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : JSP Expression Language Comparison with WebWork 1.x
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 17, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>Situation</th><th>Previous (WW-1.4)</th><th>Current (WW-2.1)</th>
|
||||
</tr><tr>
|
||||
<td>Referring to an object in the PageContext scope</td><td>@itemIdOrName</td><td>#attr['itemIdOrName']</td>
|
||||
</tr><tr>
|
||||
<td>Referring to an object in the Request scope</td><td>itemIdOrName</td><td>Same, but use #request['itemIdOrName'] if nested in an iteration.</td>
|
||||
</tr><tr>
|
||||
<td>Referring to an object in the Session scope</td><td>@itemIdOrName</td><td>#session['itemIdOrName']</td>
|
||||
</tr><tr>
|
||||
<td>Referring to an object in the Application scope</td><td>@itemIdOrName</td><td>#application['itemIdOrName']</td>
|
||||
</tr><tr>
|
||||
<td>Property Setters</td><td>foo/bar translates to getFoo().setBar()</td><td>foo.bar translates to getFoo().setBar()</td>
|
||||
</tr><tr>
|
||||
<td>Property Getters</td><td>foo/bar translates to getFoo().getBar()</td><td>foo.bar translates to getFoo().getBar()</td>
|
||||
</tr><tr>
|
||||
<td>Boolean/boolean Property Getters</td><td>foo/bar translates to getFoo().getBar() if bar is java.lang.Boolean, if primitive bar translates to getFoo().isBar()</td><td> Same, except uses dot notation instead of a slash (i.e. foo.bar)</td>
|
||||
</tr><tr>
|
||||
<td>Collections as Properties</td><td>N/A</td><td>Collections (including arrays) are similar to other objects, except they allow indexing: foo.bar[indexOrKeyName] translates to getFoo().getBar().get(indexOrKeyName)</td>
|
||||
</tr><tr>
|
||||
<td>curly braces - {}, evaluates contents of braces first, and use the result as the property to then evaluate. </td><td><webwork:property value="{'name'}"/> translates to getName() on the curent object.</td><td>No longer used.</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
<em class="emphasis">Originally written by Jay Bose and sent to the mailing list</em>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,95 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : JSP标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : JSP标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 30, 2004 by <font color="#0050B2">jcarreira</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h1 style="margin: 4px 0px 4px 0px;" class="heading1"><a name="JSPTags-WebWork%26%23039%3BsSupportedViewsJSP">WebWork支持的视图 - JSP</a></h1></p>JavaServer Pages (JSP)是WebWork(WW)支持的重要视图技术. 本节提供将JSP作为WebWork的一项视图技术的相关知识.<p class="paragraph"><b class="strong">参考内容</b>
|
||||
<ol>
|
||||
<li> <a href="Non-UI Tags.html" title="Non-UI Tags">非UI标签</a></li>
|
||||
<li> <a href="UI Tags.html" title="UI Tags">UI标签</a><ol>
|
||||
<li> <a href="Templates.html" title="Templates">模版</a> (UI标签如何绘制HTML)</li>
|
||||
<li> <a href="Themes.html" title="Themes">主题</a></li>
|
||||
</ol></li>
|
||||
<li> <a href="Iteration Tags.html" title="Iteration Tags">迭代标签</a></li>
|
||||
<li> <a href="Common Tags.html" title="Common Tags">通用标签</a></li>
|
||||
</ol><br/>
|
||||
也可以查看<a href="WebWork 2 UI Tag Guide.html" title="WebWork 2 UI Tag Guide">WebWork 2 UI标签指南</a>.</p><h2 class="heading2"><a name="JSPTags-Background">背景</a></h2><p class="paragraph">那么什么是JSP呢? 从技术角度来看, JSP是"一个有Web开发人员创建的包含JSP技术特定的标签, 声明和脚本, 并与其它静态标签(HTML or XML)组合而成的页面. JSP页面使用扩展名.jsp; 这通知web服务器使用JSP引擎处理页面上的元素." 更多信息参见JSP文档.</p>另外, JSP"提供简单, 快速的创建显示动态生成内容的web页面的方法. JSP规范, 由Sun领导在一个行业领域制定, 定义了服务器和JSP页面的交互情况, 描述了页面的格式和语法." 更多信息参见JSP文档.<p class="paragraph">因此你可以创建第一个JSP并部署到Web服务器中. 当用户第一次访问页面时, servlet容器如Tomcat将把JSP编译成Servlet, 并用它绘制Web页面. 那么, 如果最终结果是servlet, 为什么不直接编写servlet? 因为Servlet不是从Web内容中抽象Web表示的有效方式. 在早期, 人们只使用Servlet编写Web页面. 开发者可以使用Serlet动态输出HTML代码. 典型办法是输出HTML代码 - out.write("<HTML>..);. 对于维护而言这种方法简直是噩梦, 且开发成本很大, 因为它需要一个Java开发人员.</p>JSP技术出现后, 开发者可以使用者一新技术作为表示层. 早期的JSP规范有限地支持定制标签, 因此早期开发这使用脚本和JavaScript创建动态站点. 混合使用Java和HTML并不那么理想, 因为Java代码包含在标签中. 这使JSP代码难以阅读理解. 对于简单的站点这种方法可以工作的很好, 但不适于复杂站点. 复杂站点需要一种可管理, 可维护的方式抽象设计和逻辑.<p class="paragraph">目前JSP已经成熟了, 对定制标签提供强大的支持. 开发者可以编写定制标签库来实现简单或复杂的任务. 定制标签使用与HTML和XML一致的简单语义格式抽象功能. 使用编写良好的JSP标签, 开发者可以不使用Java代码来开发和维护复杂站点.</p><h2 class="heading2"><a name="JSPTags-WebWork%26%23039%3BsJSPtags">WebWork的JSP标签</a></h2><p class="paragraph">最初编写一个JSP标签是令人畏缩的任务, 但不用担心, WebWork提供了扩展标签库来简化Web站点开发. 标签库分成<a href="Non-UI Tags.html" title="Non-UI Tags">非UI标签</a> and <a href="UI Tags.html" title="UI Tags">UI标签</a>两部分. 两者之间主要区别是, UI标签包含一个隐含JSP模版来绘制HTML表单空间或一组HTML标签产生组合输出结果如table. 这些模版时缺省的并可以满足开发要求. 但是如果你有其他需求, WebWork也提供了使用你自己的模版替代缺省模版的能力. 另外, 你也可以将这些模版组织在一个目录下作为一个主题引用.</p>主题提供了为站点更换外观(skin)的能力. 一套外观不仅仅意味着不同的图形, 颜色等. 还意味着不同视图技术对应的不同视觉效果. 例如, 你可以为WAP, HTML和DHTML分别定义主题.<p class="paragraph">非UI提供对流程控制, 国际化, WebWork活动, 迭代, 文本, JavaBean等功能的支持.</p>关于这些标签更详细的描述在WebWork标签库附录中: <a href="Non-UI Tags.html" title="Non-UI Tags">非UI标签</a>, <a href="UI Tags.html" title="UI Tags">UI标签</a>.<p class="paragraph"><h2 class="heading2"><a name="JSPTags-Anexample">示例</a></h2></p>介绍如何在WebWork使用JSP视图技术的最佳方式是学习一个简单但完整的例子. 我们考察的例子实际上是一个网上商店应用, 如果你已经部署了WebWork的例子, 就可以在index.jsp中找到它. WebWork提供了许多例子以便人们更好的理解它的特性和能力. 网上商店应用是一个绝好的例子, 因为它使用了大量WebWork特性.<p class="paragraph">在进入示例细节之前, 先看一下应用的用例(use case). 下面的列表展示了订购CD的流程.</p><ol>
|
||||
<li> 应用引导用户选择语言.</li>
|
||||
<li> 为用户提供CD列表. 列表中包含了每个CD的唱片名, 艺术家, 和价格.</li>
|
||||
<li> 用户选择想要的CD及数量将它们放入购物车.</li>
|
||||
<li> 用户继续向购物车中添加或删除CD.</li>
|
||||
<li> 用户想要订货时将进行核对, 这时需要显示购物车中的内容.</li>
|
||||
<li> 如果愿意的话用户可以再次购物.</li>
|
||||
</ol>
|
||||
<h3 class="heading3"><a name="JSPTags-Step1Userselectsdesiredlanguage">第一步 - 用户选择语言</a></h3><p class="paragraph">让我们开始浏览应用. 当你在示例索引页面种选择该应用时, 它将连接到webwork/i18n/index.jsp. 通过查看该页面, 我们知道它将转向活动 - i18n.Language.action. 缺省情况下, WebWork将*.action映射到ServletDispatcher. 该类负责获取适当的活动类并执行它. 如果执行结果被指定到一个视图(JSP), 将转向该视图.</p>ServletDispatcher通过解析请求URI来决定使用哪一个活动类. 本例中, URI是i18n.Language.action. 该URI直接映射到webwork.action.test.i18n包中的类Language. 注意URI并不是 webwork.action.test.i18n.Language.action而仅仅是i18n.Language.action. 这时因为我们在webwork.properties文件中重新定义了 webwork.action.packages属性. 这允许在任何活动前使用前缀webwork.action.test.<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>webwork.action.packages=webwork.action.test, webwork.action.standard</pre>
|
||||
</div></div><p class="paragraph">现在查看活动Language. 第一个发现是它扩展了Shop(Shop扩展了ActionSupport). 该类是一个你将多次使用的基类. 我们将在后面看到, 该类提供了一组有用的功能. 另外, 它提供了执行的缺省流程. 缺省情况下活动将执行execute方法. 当在ActionSupport类执行execute时, 它将判断URI是否有一个命令后缀如!foo. 本例中foo是需要执行的命令. 该命令将被转换成doFoo()方法调用, 由ActionSupport在活动中调用. 这允许你调用活动中的方法.</p><p class="paragraph">我们的URI不是一个命令, 因此ActionSupport将首先调用doValidate()方法. 这允许你在执行前完成校验. 由于我们没有该方法, ActionSupport将调用doExecute(). 本例中, Language监察是否已经设置了语言. 如果没有, 将返回ERROR. ServletDispatcher查找与i18n.Language.error对应的视图. 查看WEB-INF/classes目录下的views.properties文件, 可以找到应用的设置信息如下. 对于该错误, 可以查到它对应于langauge.jsp.因此dispatcher将转向该页面.</p>Webshop view mapping:<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre># Webshop (I18N example adaptation) i18n.Shop.success=shop.jsp i18n.Add.success=shop.jsp i18n.Delete.success=shop.jsp i18n.Checkout.success=checkout.jsp i18n.Language.success=shop.jsp i18n.Language.error=language.jsp i18n.Restart.success=shop.jsp i18n.Cart.success=cart.jsp i18n.CDList.success=cdlist.jsp</pre>
|
||||
</div></div><p class="paragraph">那么当活动被提取出来时真正发生了什么? 缺省情况下, WebWork使用DefaultActionFactory作为ActionFactory. 该工厂和其他链接一起的工厂将被调用并视图完成活动获取.</p>以Language为例. Dispatcher将调用DefaultActionFactory并要求它返回对应的活动. 该工厂把请求放在链上. 一旦放在链上, 每一个工厂要么忽略请求, 要么对活动进行某些处理, 也可以返回活动. 下面的列表是DefaultActionFactory包含的工厂代理.<br/>
|
||||
|
||||
<ol>
|
||||
<li> ParametersActionFactoryProxy - 为匹配的参数调用活动的Setter方法.</li>
|
||||
<li> PrepareActionFactoryProxy - 调用活动的prepare()方法. 允许活动在校验或执行前完成任何需要的准备活动.</li>
|
||||
<li> ContextActionFactoryProxy - 设置活动上下文(context). 活动可以实现*Aware接口通知代理需要设置哪些内容.</li>
|
||||
<li> CommandActionFactoryProxy - 剥去URI中的命令并将命令设置到活动中.</li>
|
||||
<li> AliasingActionFactoryProxy - 如果URI是一个别名, 将获取活动名称.</li>
|
||||
<li> JspActionFactoryProxy - 将JSP包装成活动.</li>
|
||||
<li> PrefixActionFactoryProxy - 使用配置文件中的前缀查找活动类.</li>
|
||||
<li> XMLActionFactoryProxy - 获取一个XML活动.</li>
|
||||
<li> ScriptActionFactoryProxy - 包装并执行JavaScript.</li>
|
||||
<li> JavaActionFactory - 返回适当的Java活动对象.</li>
|
||||
</ol><br/>
|
||||
如你所见, 在DefaultActionFactory的盖头下发生了许多事情. 让我们回到例子中开始查看选择语言的页面language.jsp. 在这个页面中, 使用单选按钮(radio button)显示了一组语言列表. 让我们进一步产看绘制控件的代码.<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><webwork:action name=<span class="java-quote">"'i18n.LanguageList'"</span>> <ui:radio label=<span class="java-quote">"'Language'"</span> name=<span class="java-quote">"'language'"</span> list=<span class="java-quote">"languages"</span>/> </webwork:action></pre>
|
||||
</div></div><p class="paragraph">首先注意非UI标签action. 该标签执行活动LanguageList. 执行时, 该类将加载locale-to-language映射表并保存到属性languages中. 该标签随后将活动对象放入值栈以便引用.</p>现在看看UI标签radio. 该标签创建一个HTML的INPUT控件, 类型为radio. 控键的名字是language, 控件的文本是Language. 控件的值来自于活动LanguageList的getLanguages()方法调用. 该标签随后遍历映射表将键值作为VALUE属性, 映射值作为显示的文本.<p class="paragraph">现在用户可以选择语言并提交表单. 表单被再次提交到活动Language. 这一次请求参数language包含在请求中. 当活动再次创建时, ParametersActionFactoryProxy将调用活动的setter方法. 这意味着调用方法setLanguage(). 现在, 当doExecute()执行时会发现用户已经选择了语言, 这时将创建对应的Locale对象并将它放入用户的session中.</p><div class="code"><div class="codeContent">
|
||||
<pre>session.put(<span class="java-quote">"locale"</span>, locale);</pre>
|
||||
</div></div><p class="paragraph">注意将信息放入session是多么的简单. 但session属性是从哪来的呢? 记住活动继承了Shop而该类实现了SessionAware接口. 因为SessionAware包含的setSession()方法将被调用来设置用户的session. 现在我们将locale放入session并返回SUCCESS. Dispatcher将查找别名为i18n.Language.success并发现它映射为shop.jsp. 用户将被转到该页面开始购物.</p><h3 class="heading3"><a name="JSPTags-Step2UserispresentedwithalistofCDs">第二步 - 显示CD列表</a></h3><p class="paragraph">在这一步中, 用户已经选择了语言并将locale对象放入session. 用户现在在shop.jsp中. 查看该页面的代码我们发现几处使用了非UI标签text. 该标签从资源包中提取文本. 该标签能识别locale并使用适当的资源包获取正确的文本.</p><div class="code"><div class="codeContent">
|
||||
<pre><webwork:text name=<span class="java-quote">"'main.title'"</span>/></pre>
|
||||
</div></div><p class="paragraph">我们也注意到该页面包含另一个页面i18n.CDList.action. 非UI标签include将调用活动CDList如果成功的话将在页面中包含cdlist.jsp. 活动CDList将从文本文件中加载CD列表并放入list. CD列表加载完毕后我们将注意力转移到页面cdlist.jsp</p><div class="code"><div class="codeContent">
|
||||
<pre>CD:<webwork:include page=<span class="java-quote">"i18n.CDList.action"</span> /></pre>
|
||||
</div></div><p class="paragraph">cdlist.jsp提供一个SELECT表单控件.
|
||||
本例中, 我们不使用WebWork的UI标签select. 我们使用WebWork的非UI标签iterator来创建SELECT控件. 该标签可以遍历CD列表. 那么CD列表从哪里来呢? 记住, 在此之前我们调用了CDList. 活动调用后, WebWork将活动放入值栈以便视图引用. 因此, 我们将使用活动CDList的方法getCDList(). 该方法返回list而iterator标签将遍历它. 每一次迭代都将输出一个OPTION元素. 还需要注意非UI标签property. 对于列表中的每一个成员, property标签从CD中取出唱片名, 艺术家, 和国家. 还需要注意最后一个property使用活动ComputePrice来决定CD的价格. 语义@pricer/computePrice(price)意味着调用对象pricer的getComputePrice方法并将CD的价格作为参数. 非常酷. <img class="rendericon" src="./icons/emoticons/smile.gif" height="20" width="20" align="absmiddle" alt="" border="0"/></p><div class="code"><div class="codeContent">
|
||||
<pre><webwork:action name=<span class="java-quote">"'webwork.action.test.i18n.ComputePrice'"</span> id=<span class="java-quote">"pricer"</span>/> <select name=<span class="java-quote">"album"</span>> <webwork:iterator value=<span class="java-quote">"CDList"</span>> <option value=<span class="java-quote">"<webwork:property value="</span>album<span class="java-quote">"/>"</span>> <webwork:property value=<span class="java-quote">"album"</span>/>, <webwork:property value=<span class="java-quote">"artist"</span>/>, <webwork:property value=<span class="java-quote">"country"</span>/>, <webwork:property value=<span class="java-quote">"@pricer/computePrice(price)"</span>/> </option> </webwork:iterator> </select></pre>
|
||||
</div></div><p class="paragraph">现在回到shop.jsp. 查看代码进一步展示的其他有趣的方面. 看看UI标签textfield的label属性. 注意属性的值是方法调用text('main.qtyLabel'). 该方法从资源文件中获取对应的字符串. 但是活动有getText()方法吗? 记住Shop扩展了ActionSupport. 该活动提供该方法.</p><div class="code"><div class="codeContent">
|
||||
<pre><ui:textfield label=<span class="java-quote">"text('main.qtyLabel')"</span> name=<span class="java-quote">"'quantity'"</span> value=<span class="java-quote">"1"</span> size=<span class="java-quote">"3"</span>/></pre>
|
||||
</div></div><p class="paragraph">shop.jsp中最后一个值的关注的内容是它包含了用户购物车.</p><div class="code"><div class="codeContent">
|
||||
<pre><webwork:include value=<span class="java-quote">"'cart.jsp'"</span> /></pre>
|
||||
</div></div><p class="paragraph">当cart.jsp(见下文)被包含时, 使用下面的代码取得用户购物内容. 属性value的值被转换成一组方法调用getCart()/getItems(). Shop调用的第一个方法将返回Cart, 然后在Cart上调用下一个方法. 如果第一个方法没有取得cart, Shop将创建一个空的cart并放入用户session.</p><div class="code"><div class="codeContent">
|
||||
<pre><webwork:property value=<span class="java-quote">"cart/items"</span>> <webwork:<span class="java-keyword">if</span> test=<span class="java-quote">"."</span>> <center> <table border=<span class="java-quote">"0"</span> cellpadding=<span class="java-quote">"0"</span> width=<span class="java-quote">"100%"</span> bgcolor='<webwork:text name=<span class="java-quote">"'cart.bgcolor'"</span>/>'> <tr> <td><b><webwork:text name=<span class="java-quote">"'cd.albumLabel'"</span>/></b></td> <td><b><webwork:text name=<span class="java-quote">"'cd.artistLabel'"</span>/></b></td> <td><b><webwork:text name=<span class="java-quote">"'cd.countryLabel'"</span>/></b></td> <td><b><webwork:text name=<span class="java-quote">"'cd.priceLabel'"</span>/></b></td> <td><b><webwork:text name=<span class="java-quote">"'cd.quantityLabel'"</span>/></b></td> <td></td> </tr> <webwork:action name=<span class="java-quote">"'i18n.ComputePrice'"</span> id=<span class="java-quote">"pricer"</span>/> <webwork:iterator> <tr> <webwork:property value=<span class="java-quote">"cd"</span>> <td><b><webwork:property value=<span class="java-quote">"album"</span>/></b></td> <td><b><webwork:property value=<span class="java-quote">"artist"</span>/></b></td> <td><b><webwork:property value=<span class="java-quote">"country"</span>/></b></td> <td><b><webwork:property value=<span class="java-quote">"@pricer/computePrice(price)"</span>/></b></td> </webwork:property> <td><b><webwork:property value=<span class="java-quote">"quantity"</span>/></b></td> <td> <form action=<span class="java-quote">"i18n.Delete.action"</span> method=<span class="java-quote">"post"</span>> <input type=submit value='<webwork:text name=<span class="java-quote">"'cart.delLabel'"</span>/>'> <input type=hidden name=<span class="java-quote">"album"</span> value='<webwork:property value=<span class="java-quote">"cd/album"</span>/>'> </form> </td> </tr> </webwork:iterator> </table> <p> <p> <form action=<span class="java-quote">"i18n.Checkout.action"</span> method=<span class="java-quote">"post"</span>> <input type=<span class="java-quote">"submit"</span> value='<webwork:text name=<span class="java-quote">"'cart.checkoutLabel'"</span>/>'> </form> </center> </webwork:<span class="java-keyword">if</span>> </webwork:property></pre>
|
||||
</div></div><p class="paragraph"><h3 class="heading3"><a name="JSPTags-Step3UseraddsCDtotheirshoppingcart">第三步 - 用户向购物车中增加CD</a></h3></p>现在用户看到CD列表. 用户选择一个CD, 输入数量并提交表单. 表单提交到i18n.Add.action, 它对应于活动Add. 提交的参数被设置到活动中. 在我们的场景中, 它包括数量和唱片名. 随后活动的doExecute()方法被调用, 获取用户的购物车并将CD加入进去. 活动返回SUCCESS, 它映射到shop.jsp. 这次用户的购物车中有内容并显示在CD列表下面.<p class="paragraph"><h3 class="heading3"><a name="JSPTags-Step4UsercontinuestoaddorremoveCDs">第四步 - 用户继续增加或删除CD</a></h3></p>这里用户重复增加或删除CD的过程. 当他结束购物时, 将进行核对.<p class="paragraph"><h3 class="heading3"><a name="JSPTags-Step5Userchecksout">第五步 - 用户核对</a></h3></p>本步骤中, 用户结束购物并决定进行核对. 表单提交到i18n.Checkout.action. 它对应于活动Checkout. 该活动计算用户购物车中物品的总额并将它设置到属性totalPrice. 活动返回SUCCESS, 它对应视图checkout.jsp. 该视图显示用户购物车中的物品以及总价.<p class="paragraph"><h3 class="heading3"><a name="JSPTags-Step6Usercanshopagainifdesired.">第六步 - 如果愿意用户可以再次购物</a></h3></p>本步骤中, 用户可以再次购物. 如果他们选择重新开始, 可以选择链接i18n.Restart.action. 该活动删除用户购物车并返回SUCCESS, 它对应视图shop.jsp, 重新开始整个过程.<p class="paragraph"><h2 class="heading2"><a name="JSPTags-Summary">总结</a></h2></p>希望本示例能成为您理解使用WebWork特性的JSP的起点. 本例并没有完全展示WebWork, 它仅仅是一个简介. 还有其他的例子可以帮助你进一步了解WebWork. 另外, 你还可以阅读referecnce章节以了解WebWork更多信息.
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,42 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : JUnit</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : JUnit
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Jun 09, 2004 by <font color="#0050B2">ctran</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">你可以采用几种方法对活动类进行单元测试.</p><h2 class="heading2"><a name="JUnit-Thesimplestistoinstantiateyouractions%2Ccallsettersthenexecute%28%29.Thisallowsyoutobypassallthecomplicatedcontainersetup."> 最简单的办法是初始化活动类, 调用setters, 然后调用execute(). 这样可以跳过所有复杂的容器设置工作.</a></h2><p class="paragraph">从Petsoar中摘录的例子:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="java-keyword">package</span> org.petsoar.actions.inventory; <span class="java-keyword">import</span> com.mockobjects.constraint.IsEqual; <span class="java-keyword">import</span> com.mockobjects.dynamic.C; <span class="java-keyword">import</span> com.mockobjects.dynamic.Mock; <span class="java-keyword">import</span> com.opensymphony.xwork.Action; <span class="java-keyword">import</span> junit.framework.TestCase; <span class="java-keyword">import</span> org.petsoar.pets.Pet; <span class="java-keyword">import</span> org.petsoar.pets.PetStore; <span class="java-keyword">public</span> class TestViewPet <span class="java-keyword">extends</span> TestCase { <span class="java-keyword">private</span> Mock mockPetStore; <span class="java-keyword">private</span> ViewPet action; <span class="java-keyword">protected</span> void setUp() <span class="java-keyword">throws</span> Exception { mockPetStore = <span class="java-keyword">new</span> Mock(PetStore.class); PetStore petStore = (PetStore) mockPetStore.proxy(); action = <span class="java-keyword">new</span> ViewPet(); action.setPetStore(petStore); } <span class="java-keyword">public</span> void testViewPet() <span class="java-keyword">throws</span> Exception { Pet existingPet = <span class="java-keyword">new</span> Pet(); existingPet.setName(<span class="java-quote">"harry"</span>); existingPet.setId(1); Pet expectedPet = <span class="java-keyword">new</span> Pet(); expectedPet.setName(<span class="java-quote">"harry"</span>); expectedPet.setId(1); mockPetStore.expectAndReturn(<span class="java-quote">"getPet"</span>, C.args(<span class="java-keyword">new</span> IsEqual(<span class="java-keyword">new</span> <span class="java-object">Long</span>(1))), existingPet); action.setId(1); <span class="java-object">String</span> result = action.execute(); assertEquals(Action.SUCCESS, result); assertEquals(expectedPet, existingPet); mockPetStore.verify(); } <span class="java-keyword">public</span> void testViewPetNoId() <span class="java-keyword">throws</span> Exception { mockPetStore.expectAndReturn(<span class="java-quote">"getPet"</span>, C.ANY_ARGS, <span class="java-keyword">null</span>); <span class="java-object">String</span> result = action.execute(); assertEquals(Action.ERROR, result); assertEquals(1, action.getActionErrors().size()); assertEquals(<span class="java-quote">"Invalid pet selected."</span>, action.getActionErrors().iterator().next()); assertNull(action.getPet()); mockPetStore.verify(); } <span class="java-keyword">public</span> void testViewPetInvalidId() <span class="java-keyword">throws</span> Exception { action.setId(-1); testViewPetNoId(); } }</pre>
|
||||
</div></div></p><h2 class="heading2"><a name="JUnit-Testinterceptorsand%2Forresulttypes"> 测试截取器和结果类型</a></h2><p class="paragraph">查看XWork/WebWork中的测试用例. 它很全面并提供了很好的起点. 例如, 下面是如何测试<b class="strong">ParametersInterceptor</b>:</p><div class="code"><div class="codeContent">
|
||||
<pre><span class="java-keyword">public</span> void testDoesNotAllowMethodInvocations() { Map params = <span class="java-keyword">new</span> HashMap(); params.put(<span class="java-quote">"@java.lang.<span class="java-object">System</span>@exit(1).dummy"</span>, <span class="java-quote">"dumb value"</span>); HashMap extraContext = <span class="java-keyword">new</span> HashMap(); extraContext.put(ActionContext.PARAMETERS, params); <span class="java-keyword">try</span> { ActionProxy proxy = ActionProxyFactory.getFactory(). createActionProxy(<span class="java-quote">"", MockConfigurationProvider.MODEL_DRIVEN_PARAM_TEST, extraContext); assertEquals(Action.SUCCESS, proxy.execute()); ModelDrivenAction action = (ModelDrivenAction) proxy.getAction(); TestBean model = (TestBean) action.getModel(); <span class="java-object">String</span> property = <span class="java-object">System</span>.getProperty("</span>webwork.security.test"); assertNull(property); } <span class="java-keyword">catch</span> (Exception e) { e.printStackTrace(); fail(); } }</pre>
|
||||
</div></div>
|
||||
<p class="paragraph">注意: 这不是唯一的办法, 因此请自己决定.</p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,61 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : JasperReports Result</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : JasperReports Result
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 13, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h4 style="margin: 4px 0px 4px 0px;" class="heading4"><a name="JasperReportsResult-JasperReports"> JasperReports </a></h4>
|
||||
Generates a JasperReports report using the specified format or PDF if no format is specified.</p><table class="wikitable">
|
||||
<tr>
|
||||
<th>Parameters </th><th> Required </th><th> Description </th>
|
||||
</tr><tr>
|
||||
<td> location </td><td> <b class="strong">yes</b> </td><td> the location to go to after execution </td>
|
||||
</tr><tr>
|
||||
<td> parse </td><td> no </td><td> true by default. If set to false, the location param will not be parsed for Ognl expressions </td>
|
||||
</tr><tr>
|
||||
<td> dataSource </td><td> <b class="strong">yes</b> </td><td> the Ognl expression used to retrieve the datasource from the value stack (usually a List) </td>
|
||||
</tr><tr>
|
||||
<td> format </td><td> no </td><td>the format in which the report should be generated, defaults to pdf </td>
|
||||
</tr><tr>
|
||||
<td> contentDisposition </td><td> no </td><td> defaults to "inline" when using documentName unless specified </td>
|
||||
</tr><tr>
|
||||
<td> documentName </td><td> no </td><td> generates the http header "Content-disposition = <contentDisposition>; filename=<documentName>.<format>" </td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"jasper"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"location"</span>></span>foo.jasper<span class="xml-tag"></param></span> <span class="xml-tag"><param name=<span class="xml-quote">"dataSource"</span>></span>mySource<span class="xml-tag"></param></span> <span class="xml-tag"><param name=<span class="xml-quote">"format"</span>></span>CSV<span class="xml-tag"></param></span> <span class="xml-tag"></result></span></pre>
|
||||
</div></div><br/>
|
||||
or for pdf
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"jasper"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"location"</span>></span>foo.jasper<span class="xml-tag"></param></span> <span class="xml-tag"><param name=<span class="xml-quote">"dataSource"</span>></span>mySource<span class="xml-tag"></param></span> <span class="xml-tag"></result></span></pre>
|
||||
</div></div>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,67 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Label标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Label标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="Labeltag-%26lt%3Bww%3Alabel%2F%26gt%3B"><ww:label /></a></h3></p>HTML的LABEL标签: 和其他UI控件有相同的格式. <p class="paragraph">
|
||||
<b class="strong">属性</b>
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th> 名字 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> id </td><td> 否 </td><td> HTML的id属性 </td>
|
||||
</tr><tr>
|
||||
<td> name </td><td> <b class="strong">是</b> </td><td> HTML的name属性 </td>
|
||||
</tr><tr>
|
||||
<td> value </td><td> 否 </td><td> 作为字段值 </td>
|
||||
</tr><tr>
|
||||
<td> label </td><td> 否 </td><td> 用于模版中的标签文字 </td>
|
||||
</tr><tr>
|
||||
<td> labelposition </td><td> 否 </td><td> 标签的对齐方式 (left,right,center) </td>
|
||||
</tr><tr>
|
||||
<td> required </td><td> 否 </td><td> 在表单提交时是否是必需字段 </td>
|
||||
</tr><tr>
|
||||
<td> cssClass </td><td> 否 </td><td> HTML的class属性 </td>
|
||||
</tr><tr>
|
||||
<td> cssStyle </td><td> 否 </td><td> HTML的style属性 </td>
|
||||
</tr><tr>
|
||||
<td> theme </td><td> 否 </td><td> 使用的主题 </td>
|
||||
</tr><tr>
|
||||
<td> template </td><td> 否 </td><td> 使用的模版名 </td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
|
||||
本例中绘制了一个文本标签. 它通过调用ActionSupport的getText()方法从ResourceBundle中提取文本"user_name".
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww:label label=<span class="xml-quote">"text('user_name')"</span> name=<span class="xml-quote">"'a label'"</span>/></span></pre>
|
||||
</div></div></p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,36 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 许可(License)</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 许可(License)
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
本页由<font color="#0050B2">plightbo</font>最后修改于2004年11月12日.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">[<i>All OpenSymphony projects use the OpenSymphony License, which is a modified Apache License. You can find the license at <a href="http://www.opensymphony.com/license.html" title="Visit page outside Confluence">http://www.opensymphony.com/license.html</a></i>]</p>
|
||||
<p class="paragraph">OpenSymphony的全部项目均适用OpenSymphony许可协议, 它是Apache许可协议的一个修改版本. 您可以在<a href="http://www.opensymphony.com/license.html" title="Visit page outside Confluence">http://www.opensymphony.com/license.html</a>中查看许可协议.</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,36 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 邮件列表</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 邮件列表
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on May 19, 2004 by <font color="#0050B2">ehauser</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">Webwork邮件列表对全部开发人员和最终用户开放. 列表位于<a href="http://webwork.dev.java.net/servlets/ProjectMailingListList" title="Visit page outside Confluence">http://webwork.dev.java.net/servlets/ProjectMailingListList</a>, 使用消息往来(message-by-message)和分类格式保存. 列表的存档文件特可以从该页获取, 因此在发布新消息前请先搜索过去的消息.</p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,39 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 名空间(Namespaces)</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 名空间(Namespaces)
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Jun 17, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="Namespaces-Namespaces"> 名空间</a></h3></p>namespaces属性允许将活动配置隔离在不同名空间中, 这样你可以在多个名空间中使用同一个的活动别名配置不同的活动类(class), 参数等等. 这与Webwork 1.x不同, 1.x中全部活动名都是全局的不能在一个应用中重复使用. 缺省的名空间""(空字符串)用于"捕获(catch-all)"其他名空间, 如果一个活动没有包含在指定的名空间中, 将搜索缺省名空间. 它可以在扩展继承链之外定义一个全局活动配置, 同时也兼容Webwork 1.x版本不指定名空间的做法. 名空间的功能还可以用于安全, 例如, Webwork 2.0的 ServletDispatcher把活动名称之前的部分作为名空间, 这就使J2EE基于路径的安全机制易于实现和管理. <p class="paragraph"><h4 class="heading4"><a name="Namespaces-Namespaceexample"> 名空间示例</a></h4></p><div class="code"><div class="codeContent">
|
||||
<pre><<span class="java-keyword">package</span> name=<span class="java-quote">"<span class="java-keyword">default</span>"</span>> <action name=<span class="java-quote">"foo"</span> class=<span class="java-quote">"mypackage.simpleAction> <result name="</span>success<span class="java-quote">" type="</span>dispatcher<span class="java-quote">">greeting.jsp</result> </action> <action name="</span>bar<span class="java-quote">" class="</span>mypackage.simpleAction<span class="java-quote">"> <result name="</span>success<span class="java-quote">" type="</span>dispatcher<span class="java-quote">">bar1.jsp</result> </action> </<span class="java-keyword">package</span>> <<span class="java-keyword">package</span> name="</span>mypackage<span class="java-quote">" namespace="</span>/barspace<span class="java-quote">"> <action name="</span>bar<span class="java-quote">" class="</span>mypackage.simpleAction<span class="java-quote">"> <result name="</span>success<span class="java-quote">" type="</span>dispatcher">bar2.jsp</result> </action> </<span class="java-keyword">package</span>></pre>
|
||||
</div></div><br/>
|
||||
如果请求/barspace/bar.action, 那么将搜索mypackage包并执行活动bar. 如果活动返回success, 就显示bar2.jsp. <p class="paragraph"><ins class="inserted">注意:</ins> 如果请求/barspace/foo.action, 由于活动foo在名空间/barspace中因此被找到. 如果活动不存在, 将查找缺声明空间. 未指定时缺省名空间是"". 上例中, 名空间/barspace中没有活动foo, 因此将搜索缺省名空间并执行/foo.action.</p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,369 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 非UI类标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 非UI类标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><a name="Non-UITags-top"></a><br/>
|
||||
下列标签与值栈交互, 并控制页面逻辑.</p><table class="wikitable">
|
||||
<tr>
|
||||
<th> 标签名 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> <b class="strong"><a href="#Non-UITags-Common" title="Common on Non-UI Tags">通用标签</a></b></td><td> </td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-param" title="param on Non-UI Tags"><ww:param /></a> </td><td> 为支持参数的标签设置参数</td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-property" title="property on Non-UI Tags"><ww:property /></a> </td><td> 从值栈中提取值并显示 </td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-push" title="push on Non-UI Tags"><ww:push /></a> </td><td> 将指定对象压入值栈顶端 </td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-set" title="set on Non-UI Tags"><ww:set /></a> </td><td> 创建你自己的命名变量 </td>
|
||||
</tr><tr>
|
||||
<td> <a href="URL tag.html" title="URL tag">URL tag</a> (<ww:url />) </td><td> 构建一个已编码的URL </td>
|
||||
</tr><tr>
|
||||
<td> <b class="strong"><a href="#Non-UITags-Componentisation" title="Componentisation on Non-UI Tags">组件化标签</a></b> </td><td> </td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-action" title="action on Non-UI Tags"><ww:action /></a> </td><td> 提供另一种调用活动的方法 </td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-bean" title="bean on Non-UI Tags"><ww:bean /></a> </td><td> 初始化一个Bean以便访问它的功能 </td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-include" title="include on Non-UI Tags"><ww:include /></a> </td><td> 用于包含另一个页面或活动 </td>
|
||||
</tr><tr>
|
||||
<td> <b class="strong"><a href="#Non-UITags-Flow-Control" title="Flow-Control on Non-UI Tags">流程控制标签</a></b></td><td> </td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-if" title="if on Non-UI Tags"><ww:if /></a> </td><td> 根据条件决定语句是否执行 </td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-elseif" title="elseif on Non-UI Tags"><ww:elseif /></a> </td><td> 当前一个测试失败后用于决定语句是否执行. </td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-else" title="else on Non-UI Tags"><ww:else /></a> </td><td> 如果前一个测试为false时执行 </td>
|
||||
</tr><tr>
|
||||
<td> <b class="strong"><a href="#Non-UITags-Iteration" title="Iteration on Non-UI Tags">迭代标签</a></b> </td><td> </td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-iterator" title="iterator on Non-UI Tags"><ww:iterator /></a> </td><td> 在一个集合上进行迭代 </td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-generator" title="generator on Non-UI Tags"><ww:generator /></a> </td><td> 常见迭代器 </td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-append" title="append on Non-UI Tags"><ww:append /></a> </td><td> 添加一个迭代器列表 </td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-subset" title="subset on Non-UI Tags"><ww:subset /></a> </td><td> 迭代一个可迭代对象的一部分 </td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-merge" title="merge on Non-UI Tags"><ww:merge /></a> </td><td> 将几个迭代器合并为一个 </td>
|
||||
</tr><tr>
|
||||
<td> <a href="#Non-UITags-sort" title="sort on Non-UI Tags"><ww:sort /></a> </td><td> 对一个迭代器排序 </td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
<a name="Non-UITags-Common"></a>
|
||||
<h2 class="heading2"><a name="Non-UITags-CommonTags"> 通用标签</a></h2><p class="paragraph"><a name="Non-UITags-param"></a>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Aparam%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:param /></b></font></a></h3></p>允许为支持增加参数的标签设置参数. <br/>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>属性名</th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>value</td><td>否</td><td>用于向标签传递数据.</td>
|
||||
</tr><tr>
|
||||
<td>name</td><td>否</td><td>调用的活动名称. </td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
你可以将param标签放置在支持参数标签的内部, param标签把参数加入到它的父标签. 如果value没有给定, 它将使用正文内容(body)作为value值.<p class="paragraph">在下面的例子中, 每一个param标签都把参数加到Counter上. 这意味着param将调用Counter对应的setter方法.</p><div class="code"><div class="codeContent">
|
||||
<pre><ww:bean name=<span class="java-quote">"'webwork.util.Counter'"</span> id=<span class="java-quote">"year"</span>> <ww:param name=<span class="java-quote">"'first'"</span> value=<span class="java-quote">"text('firstBirthYear')"</span>/> <ww:param name=<span class="java-quote">"'last'"</span> value=<span class="java-quote">"2000"</span>/> <ui:combobox label=<span class="java-quote">"'Birth year'"</span> size=<span class="java-quote">"6"</span> maxlength=<span class="java-quote">"4"</span> name=<span class="java-quote">"'birthYear'"</span> list=<span class="java-quote">"#year"</span>/> </ww:bean></pre>
|
||||
</div></div>
|
||||
<p class="paragraph"><a name="Non-UITags-property"></a><br/>
|
||||
<a href="#Non-UITags-top" title="top on Non-UI Tags">返回</a>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Aproperty%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:property /></b></font></a></h3></p>property标签从值栈中提取值并显示.<br/>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>属性名</th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>id</td><td>否</td><td>为一个元素指定唯一的名字(<a href="#Non-UITags-Notes-Id" title="Notes-Id on Non-UI Tags">注意</a>).</td>
|
||||
</tr><tr>
|
||||
<td>value</td><td>否</td><td>用于向标签传递数据.</td>
|
||||
</tr><tr>
|
||||
<td>escape</td><td>否</td><td>决定正文是否需要进行适当的转码以符合HTML字符要求[<i>如"&"转换为"&amp;"</i>]</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
下面的例子描述它的不同用法:<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>Print getX().getY() <ww:property value=<span class="java-quote">"x.y"</span>/></pre>
|
||||
</div></div><p class="paragraph">缺生情况下将对HTML字符进行转码, 然而如果property标签的内容包含在正文(body)中时, 将不进行转码. 显示使用escape属性将覆盖缺省行为. 引用的文字在转码时, 其外面的引号(quote)将被去掉.</p>还要注意如果property标签的正文为空时(has an empty body), 它的行为与没有正文时一样.
|
||||
<p class="paragraph"><a name="Non-UITags-push"></a><br/>
|
||||
<a href="#Non-UITags-top" title="top on Non-UI Tags">返回</a>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Apush%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:push /></b></font></a></h3></p>利用ww:push, 你可以将对象压入值栈的顶部. <br/>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>属性名 </th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>value</td><td><b class="strong">是</b></td><td>用于向标签传递数据.</td>
|
||||
</tr>
|
||||
</table><p class="paragraph">与ww:set(见下文)标签的功能类似, 因此在决定使用前应当都看一下.</p><div class="code"><div class="codeContent">
|
||||
<pre><ww:push value=<span class="java-quote">"counter"</span>> <ww:property value=<span class="java-quote">"count"</span>/> </ww:push></pre>
|
||||
</div></div><p class="paragraph">要将一个活动放入值栈中可以使用下面的代码:</p><div class="code"><div class="codeContent">
|
||||
<pre><ww:action name=<span class="java-quote">"'SomeAction'"</span> id=<span class="java-quote">"sa"</span>/> <ww:push value=<span class="java-quote">"#sa"</span>> foo = <ww:property value=<span class="java-quote">"foo"</span>/> </ww:push></pre>
|
||||
</div></div><br/>
|
||||
|
||||
<p class="paragraph"><a name="Non-UITags-set"></a><br/>
|
||||
<a href="#Non-UITags-top" title="top on Non-UI Tags">返回</a>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Aset%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:set /></b></font></a></h3></p>使用ww:set标签, 你可以在JSP中创建一个自己命名变量. 可以使用#variableName的形式引用该变量. <br/>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>属性名 </th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>name </td><td><b class="strong">是</b></td><td>变量的唯一名称, 可以使用"#name"访问它.</td>
|
||||
</tr><tr>
|
||||
<td>value</td><td>否</td><td>用于向标签传递数据.</td>
|
||||
</tr><tr>
|
||||
<td>scope</td><td>否</td><td>变量的作用范围: 可以是page, request, session, application</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
将值栈中对象的值设置到指定的scope中. 如果值未给定, 将使用栈顶值. 如果scope未指定, 缺省的scope是活动上下文, 如果该请求并未执行任何活动, 将使用PageContext.
|
||||
<p class="paragraph"><a name="Non-UITags-Componentisation"></a><br/>
|
||||
<a href="#Non-UITags-top" title="top on Non-UI Tags">返回</a><br/>
|
||||
<h2 class="heading2"><a name="Non-UITags-ComponentisationTags"> 组合化标签</a></h2></p>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Aaction%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:action /></b></font></a></h3><p class="paragraph">Action标签提供另一种调用活动的方法. 这是除了调用一个URL之外的另一个办法; 即 - *.action会被发送到ServletDispatcher.</p><table class="wikitable">
|
||||
<tr>
|
||||
<th>属性名 </th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>id</td><td>否</td><td>为元素指定唯一名称(<a href="#Non-UITags-Notes-Id" title="Notes-Id on Non-UI Tags">注意</a>).</td>
|
||||
</tr><tr>
|
||||
<td>name</td><td><b class="strong">是</b></td><td>被调用活动的名字. </td>
|
||||
</tr><tr>
|
||||
<td>namespace </td><td> 否 </td><td> 活动的名空间</td>
|
||||
</tr><tr>
|
||||
<td>executeResult </td><td> 否 </td><td> 是否执行结果 </td>
|
||||
</tr>
|
||||
</table><p class="paragraph">如果指定了<b class="strong">id</b>属性, 被执行的活动就可以使用"<b class="strong">#id</b>"在活动上下文中引用.</p>本例中, 活动ClientInfo将被执行, 它的方法将被用于获取信息并执行条件检查.<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww:action name=<span class="xml-quote">"'ClientInfo'"</span> id=<span class="xml-quote">"cinfo"</span>></span> <span class="xml-tag"><ww:param name=<span class="xml-quote">"detailedMode"</span> value=<span class="xml-quote">"false"</span>/></span> <span class="xml-tag"></ww:action></span> Browser:<span class="xml-tag"><ww:property value=<span class="xml-quote">"#cinfo.browser"</span>/></span><span class="xml-tag"><br></span> Version:<span class="xml-tag"><ww:property value=<span class="xml-quote">"#cinfo.version"</span>/></span><span class="xml-tag"><br></span> Supports GIF:<span class="xml-tag"><ww:if test=<span class="xml-quote">"#cinfo.supportsType('image/gif') == true"</span>></span>Yes<span class="xml-tag"></ww:if></span> <span class="xml-tag"><ww:else></span>No<span class="xml-tag"></ww:else></span><span class="xml-tag"><br></span></pre>
|
||||
</div></div> <p class="paragraph"><a href="#Non-UITags-top" title="top on Non-UI Tags">返回</a><br/>
|
||||
<a name="Non-UITags-bean"></a>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Abean%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:bean /></b></font></a></h3></p>创建一个JavaBean并初始化它的属性, 并将它放入ActionContext.
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>属性名 </th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>id</td><td>否</td><td>为元素指定唯一名称(<a href="#Non-UITags-Notes-Id" title="Notes-Id on Non-UI Tags">注意</a>).</td>
|
||||
</tr><tr>
|
||||
<td>name</td><td><b class="strong">是</b></td><td>被调用的活动[<i>可能是笔误</i>]名. </td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
本例中, Counter被用作bean. 我们可以调用需要的方法. 本例中,我们调用setFirst()将出生年设置为1975并调用setLast()将它设置为2000. 然后将Counter作为一个迭代器显示一个组合框(combo box). <br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:bean name=<span class="java-quote">"'webwork.util.Counter'"</span> id=<span class="java-quote">"year"</span>> <ww:param name=<span class="java-quote">"'first'"</span> value=<span class="java-quote">"text('firstBirthYear')"</span>/> <ww:param name=<span class="java-quote">"'last'"</span> value=<span class="java-quote">"2000"</span>/> <ui:combobox label=<span class="java-quote">"'Birth year'"</span> size=<span class="java-quote">"6"</span> maxlength=<span class="java-quote">"4"</span> name=<span class="java-quote">"'birthYear'"</span> list=<span class="java-quote">"#year"</span>/> </ww:bean></pre>
|
||||
</div></div>
|
||||
<p class="paragraph"><a href="#Non-UITags-top" title="top on Non-UI Tags">返回</a><br/>
|
||||
<a name="Non-UITags-include"></a>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Ainclude%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:include /></b></font></a></h3></p>用于包含另一个页面或活动. <br/>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>属性名 </th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>page </td><td>否</td><td>页面或活动的名称.</td>
|
||||
</tr><tr>
|
||||
<td>value</td><td>否</td><td>用于向标签传递数据.</td>
|
||||
</tr>
|
||||
</table><p class="paragraph">本例中, beaninfo.jsp引入了一个Person对象people[0]. 看一下beaninfo.jsp的例子并注意它是如何利用".."从值栈中取出父页面的值.
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:property value=<span class="java-quote">"people[0]"</span>> <ww:include value=<span class="java-quote">"'beaninfo.jsp'"</span>/> </ww:property></pre>
|
||||
</div></div></p>本例中调用了一个活动.
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><h1>RSS viewer</h1> <ww:include value=<span class="java-quote">"'rss.viewer.action'"</span>/></pre>
|
||||
</div></div>
|
||||
<p class="paragraph"><a name="Non-UITags-FlowControl"></a>
|
||||
<h2 class="heading2"><a name="Non-UITags-FlowControlTags"> 流程控制标签</a></h2></p> <a href="#Non-UITags-top" title="top on Non-UI Tags">返回</a><br/>
|
||||
<a name="Non-UITags-if"></a>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Aif%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:if /></b></font></a></h3>
|
||||
根据条件决定语句是否执行. <br/>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>属性 </th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>id</td><td>否</td><td>为元素指定唯一名称(<a href="#Non-UITags-Notes-Id" title="Notes-Id on Non-UI Tags">注意</a>).</td>
|
||||
</tr><tr>
|
||||
<td>test</td><td><b class="strong">是</b></td><td>由WebWork解析器进行计算赋值的条件表达式. 它返回布尔值true或false. </td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
本例中, 如果测试条件为true将执行标签内容(body). elseIf标签和else标签将不被执行. <br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:<span class="java-keyword">if</span> test=<span class="java-quote">"<span class="java-keyword">true</span> == <span class="java-keyword">true</span>"</span>> <b><span class="java-keyword">if</span>: Success</b> </ww:<span class="java-keyword">if</span>> <ww:elseIf test=<span class="java-quote">"<span class="java-keyword">true</span> == <span class="java-keyword">true</span>"</span>> <b>elseIf: Failure</b> </ww:elseIf> <ww:<span class="java-keyword">else</span>> <b><span class="java-keyword">else</span>: Failure</b> </ww:<span class="java-keyword">else</span>></pre>
|
||||
</div></div><p class="paragraph"><a href="#Non-UITags-top" title="top on Non-UI Tags">return to top</a><br/>
|
||||
<a name="Non-UITags-elseif"></a>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Aelseif%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:elseif /></b></font></a></h3></p>当前一个测试失败后用于决定语句是否执行. <br/>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>属性 </th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>id</td><td>否</td><td>为元素指定唯一名称(<a href="#Non-UITags-Notes-Id" title="Notes-Id on Non-UI Tags">注意</a>).</td>
|
||||
</tr><tr>
|
||||
<td>test</td><td><b class="strong">是</b></td><td>由WebWork解析器进行计算赋值的条件表达式. 它返回布尔值true或false. </td>
|
||||
</tr>
|
||||
</table><br/><p class="paragraph">本例中, 由于elseIf标签的条件为true而if标签的条件为false, 因此将执行其内容(body).</p><div class="code"><div class="codeContent">
|
||||
<pre><ww:<span class="java-keyword">if</span> test=<span class="java-quote">"<span class="java-keyword">true</span> == <span class="java-keyword">false</span>"</span>> <b><span class="java-keyword">if</span>: Failures</b> </ww:<span class="java-keyword">if</span>> <ww:elseIf test=<span class="java-quote">"<span class="java-keyword">true</span> == <span class="java-keyword">true</span>"</span>> <b>elseIf: Success</b> </ww:elseIf> <ww:<span class="java-keyword">else</span>> <b><span class="java-keyword">else</span>: Failure</b> </ww:<span class="java-keyword">else</span>></pre>
|
||||
</div></div><p class="paragraph"><a href="#Non-UITags-top" title="top on Non-UI Tags">return to top</a><br/>
|
||||
<a name="Non-UITags-else"></a>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Aelse%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:else /></b></font></a></h3></p>如果前一个测试为false时执行. <br/>
|
||||
|
||||
<table class="wikitable">
|
||||
<th>属性 </th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>id</td><td>否</td><td>为元素指定唯一名称(<a href="#Non-UITags-Notes-Id" title="Notes-Id on Non-UI Tags">注意</a>).</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
本例中, 由于if标签和elseIf标签的条件均为false, else标签将执行其内容(body). <br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:<span class="java-keyword">if</span> test=<span class="java-quote">"<span class="java-keyword">true</span> == <span class="java-keyword">false</span>"</span>> <b><span class="java-keyword">if</span>: Failures</b> </ww:<span class="java-keyword">if</span>> <ww:elseIf test=<span class="java-quote">"<span class="java-keyword">true</span> == <span class="java-keyword">false</span>"</span>> <b>elseIf: Failure</b> </ww:elseIf> <ww:<span class="java-keyword">else</span>> <b><span class="java-keyword">else</span>: Success</b> </ww:<span class="java-keyword">else</span>></pre>
|
||||
</div></div><p class="paragraph"><a name="Non-UITags-Iteration"></a>
|
||||
<h2 class="heading2"><a name="Non-UITags-IterationTags"> 迭代标签</a></h2></p> <a href="#Non-UITags-top" title="top on Non-UI Tags">返回</a><br/>
|
||||
<a name="Non-UITags-iterator"></a>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Aiterator%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:iterator /></b></font></a></h3>
|
||||
<p class="paragraph">Iterator标签将在一个集合之上进行迭代. 可迭代的值可以是下列之一: java.util.Collection, java.util.Iterator, java.util.Enumeration, java.util.Map, 数组, XML节点 或XML的NodeList.</p><table class="wikitable">
|
||||
<tr>
|
||||
<th>属性名 </th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>id</td><td>否</td><td>为元素指定唯一名称(<a href="#Non-UITags-Notes-Id" title="Notes-Id on Non-UI Tags">注意</a>).</td>
|
||||
</tr><tr>
|
||||
<td>status</td><td>否</td><td>该属性表示IteratorStatus对象将被暴露(exposed)出来并以此命名. 使用IteratorStatus对象可以获取迭代信息: getCount(), getIndex(), isFirst(), isLast(), isEven(), isOdd(). </td>
|
||||
</tr><tr>
|
||||
<td>value</td><td>否</td><td>用于向标签传递数据.</td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
本例中, iterator标签将在Counter上进行迭代. property标签将输出从1到10的迭代值. <br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:bean name=<span class="java-quote">"'webwork.util.Counter'"</span>> <ww:param name=<span class="java-quote">"'last'"</span> value=<span class="java-quote">"10"</span>/> <ww:iterator> <ww:property/><br /> </ww:iterator> </ww:bean></pre>
|
||||
</div></div><p class="paragraph">本例中, 我们使用一对IteratorStatus以查看迭代中的位置.</p><div class="code"><div class="codeContent">
|
||||
<pre><h1>Testing iterator status</h1> <ww:bean name=<span class="java-quote">"'webwork.util.Counter'"</span> id=<span class="java-quote">"rowcounter"</span>> <ww:param name=<span class="java-quote">"'first'"</span> value=<span class="java-quote">"0"</span>/> <ww:param name=<span class="java-quote">"'last'"</span> value=<span class="java-quote">"5"</span>/> </ww:bean> <table border=<span class="java-quote">"1"</span>> <ww:iterator value=<span class="java-quote">"#rowcounter"</span> status=<span class="java-quote">"rowstatus"</span>> <tr> <ww:bean name=<span class="java-quote">"'webwork.util.Counter'"</span> id=<span class="java-quote">"colcounter"</span>> <ww:param name=<span class="java-quote">"'first'"</span> value=<span class="java-quote">"0"</span>/> <ww:param name=<span class="java-quote">"'last'"</span> value=<span class="java-quote">"5"</span>/> </ww:bean> <ww:iterator value=<span class="java-quote">"#colcounter"</span> status=<span class="java-quote">"colstatus"</span>> <!-- <span class="java-keyword">if</span> it is (first row) or (first column) or (last row) then output the column number. --> <ww:<span class="java-keyword">if</span> test=<span class="java-quote">"#rowstatus.first==<span class="java-keyword">true</span> || #colstatus.first==<span class="java-keyword">true</span> || #rowstatus.last==<span class="java-keyword">true</span>"</span>> <th><ww:property value=<span class="java-quote">"#colstatus.count"</span>/></th> </ww:<span class="java-keyword">if</span>> <ww:<span class="java-keyword">else</span>> <td><ww:property/></td> </ww:<span class="java-keyword">else</span>> </ww:iterator> </tr> </ww:iterator> </table></pre>
|
||||
</div></div><p class="paragraph">这里我们利用IteratorStatus完成隔行加入一个额外的换行. 这在绘制隔行不同的底色的HTML表格时十分有用. 奇数和偶数属性据可使用.</p><div class="code"><div class="codeContent">
|
||||
<pre><ww:iterator status=<span class="java-quote">"status"</span>> <ww:<span class="java-keyword">if</span> test=<span class="java-quote">"#status.odd == <span class="java-keyword">true</span>"</span>> <br /> </ww:<span class="java-keyword">if</span>> <br /> </ww:iterator> Here we use the IteratorStatus determine every fourth row to insert an extra line <span class="java-keyword">break</span>. <ww:iterator status=<span class="java-quote">"status"</span>> <ww:<span class="java-keyword">if</span> test=<span class="java-quote">"#status.modulus(4) == 0"</span>> <br /> </ww:<span class="java-keyword">if</span>> <br /> </ww:iterator></pre>
|
||||
</div></div><p class="paragraph">下面列出IteratorStatus对象可用的操作:
|
||||
<ul class="star">
|
||||
<li> even : boolean - 如果当前迭代位置是偶数返回true</li>
|
||||
<li> odd : boolean - 如果当前迭代位置是奇数返回true</li>
|
||||
<li> count : int - 返回当前迭代位置的计数(从1开始)</li>
|
||||
<li> index : int - 返回当前迭代位置的编号(从0开始)</li>
|
||||
<li> first : boolean - 如果当前迭代位置是第一位时返回true</li>
|
||||
<li> last : boolean - 如果当前迭代位置是最后一位时返回true</li>
|
||||
<li> modulus(operand : int) : int - 返回当前计数(从1开始)与指定操作数的模数</li>
|
||||
</ul></p> <a href="#Non-UITags-top" title="top on Non-UI Tags">返回</a><br/>
|
||||
<a name="Non-UITags-generator"></a>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Agenerator%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:generator /></b></font></a></h3><p class="paragraph">使用给定值生成迭代器(Iterator).</p><table class="wikitable">
|
||||
<tr>
|
||||
<th>属性 </th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>id</td><td>否</td><td>为元素指定唯一名称(<a href="#Non-UITags-Notes-Id" title="Notes-Id on Non-UI Tags">注意</a>).</td>
|
||||
</tr><tr>
|
||||
<td>count</td><td>否</td><td>迭代中的元素数量.</td>
|
||||
</tr><tr>
|
||||
<td>separator</td><td>否</td><td>StringTokenizer用于断字的字符.</td>
|
||||
</tr><tr>
|
||||
<td>val</td><td><b class="strong">是</b></td><td>用于生成迭代列表的字符串.</td>
|
||||
</tr>
|
||||
</table><p class="paragraph">本例中创建了两个迭代器. 一个是val="'foo,bar,xyzzy'" 另一个是val="' '".</p><div class="code"><div class="codeContent">
|
||||
<pre><h1>Testing append, subset, and value generators</h1> <table border=<span class="java-quote">"1"</span>> <ww:bean name=<span class="java-quote">"'webwork.util.Counter'"</span>> <ww:param name=<span class="java-quote">"'last'"</span> value=<span class="java-quote">"5"</span>/> <ww:iterator id=<span class="java-quote">"colcount"</span>> <tr> <!-- Generator will create an Iterator that has 5 items. The first 3 are <span class="java-quote">"foo,bar,xyzzy"</span>. Item 4 and 5 will be foo and bar respectively. If the count is more than the items, you start over. --> <ww:generator val=<span class="java-quote">"'foo,bar,xyzzy'"</span> separator=<span class="java-quote">"','"</span> count=<span class="java-quote">"#colcount"</span> id=<span class="java-quote">"values"</span>/> <!-- Generator will create an Iterator that has infinite . Count=-1 means indefinite. --> <ww:generator val=<span class="java-quote">"' '"</span> count=<span class="java-quote">"-1"</span> id=<span class="java-quote">"space"</span>/> <ww:append> <ww:param name=<span class="java-quote">"'source'"</span> value=<span class="java-quote">"#values"</span>/> <ww:param name=<span class="java-quote">"'source'"</span> value=<span class="java-quote">"#space"</span>/> <ww:subset count=<span class="java-quote">"6"</span>> <ww:iterator> <td width=<span class="java-quote">"40"</span>><ww:property/></td> </ww:iterator> </iterator:subset> </iterator:append> </tr> </ww:iterator> </ww:bean> </table></pre>
|
||||
</div></div><p class="paragraph"><img class="rendericon" src="./icons/emoticons/warning.png" height="16" width="16" align="absmiddle" alt="" border="0"/> 该标签目前是多余的, 可以使用OGNL来完成:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><ww:iterator value=<span class="java-quote">"{1, 2, 3, 4}"</span>> </ww:iterator></pre>
|
||||
</div></div></p> <a href="#Non-UITags-top" title="top on Non-UI Tags">返回</a><br/>
|
||||
<a name="Non-UITags-append"></a>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Aappend%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:append /></b></font></a></h3><p class="paragraph">Append标签用于添加一个迭代器列表. 迭代的值将被添加在一起并作为一个迭代器使用. 该迭代器的输出顺序与添加顺序一致.</p><table class="wikitable">
|
||||
<tr>
|
||||
<th>属性 </th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>id</td><td>否</td><td>为元素指定唯一名称(<a href="#Non-UITags-Notes-Id" title="Notes-Id on Non-UI Tags">注意</a>).</td>
|
||||
</tr>
|
||||
</table><p class="paragraph">本例中, 添加了两个迭代器#values和#spaces. 这意味着#spaces的值在#values之后.</p><div class="code"><div class="codeContent">
|
||||
<pre><h1>Testing append, subset, and value generators</h1> <table border=<span class="java-quote">"1"</span>> <ww:bean name=<span class="java-quote">"'webwork.util.Counter'"</span>> <ww:param name=<span class="java-quote">"'last'"</span> value=<span class="java-quote">"5"</span>/> <ww:iterator id=<span class="java-quote">"colcount"</span>> <tr> <ww:generator val=<span class="java-quote">"'foo,bar,xyzzy'"</span> separator=<span class="java-quote">"','"</span> count=<span class="java-quote">"#colcount"</span> id=<span class="java-quote">"values"</span>/> <ww:generator val=<span class="java-quote">"' '"</span> count=<span class="java-quote">"-1"</span> id=<span class="java-quote">"space"</span>/> <ww:append> <ww:param name=<span class="java-quote">"'source'"</span> value=<span class="java-quote">"#values"</span>/> <ww:param name=<span class="java-quote">"'source'"</span> value=<span class="java-quote">"#space"</span>/> <ww:subset count=<span class="java-quote">"6"</span>> <ww:iterator> <td width=<span class="java-quote">"40"</span>><ww:property/></td> </ww:iterator> </iterator:subset> </iterator:append> </tr> </ww:iterator> </ww:bean> </table></pre>
|
||||
</div></div><p class="paragraph"><a href="#Non-UITags-top" title="top on Non-UI Tags">返回</a><br/>
|
||||
<a name="Non-UITags-subset"></a>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Asubset%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:subset /></b></font></a></h3></p>Subset标签仅迭代source的一部分. 它从起点开始并进行count指定的迭代次数. 如果你想迭代到最后, 可以将count设置为-1. 如果不提供source属性, 将使用值栈的当前对象- ".". <br/>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>属性 </th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>id</td><td>否</td><td>为元素指定唯一名称(<a href="#Non-UITags-Notes-Id" title="Notes-Id on Non-UI Tags">注意</a>).</td>
|
||||
</tr><tr>
|
||||
<td>count</td><td>否</td><td>指定迭代次数.</td>
|
||||
</tr><tr>
|
||||
<td>source</td><td>否</td><td>指定本标签操作的迭代器. 可以是Enumeration, Iterator, 或Collection. </td>
|
||||
</tr><tr>
|
||||
<td>start</td><td>否</td><td>指定开始迭代的位置. </td>
|
||||
</tr>
|
||||
</table><p class="paragraph">本例中, subset标签将对值栈中当前对象的6个元素进行迭代.</p><div class="code"><div class="codeContent">
|
||||
<pre><h1>Testing append, subset, and value generators</h1> <table border=<span class="java-quote">"1"</span>> <ww:bean name=<span class="java-quote">"'webwork.util.Counter'"</span>> <ww:param name=<span class="java-quote">"'last'"</span> value=<span class="java-quote">"5"</span>/> <ww:iterator id=<span class="java-quote">"colcount"</span>> <tr> <ww:generator val=<span class="java-quote">"'foo,bar,xyzzy'"</span> separator=<span class="java-quote">"','"</span> count=<span class="java-quote">"#colcount"</span> id=<span class="java-quote">"values"</span>/> <ww:generator val=<span class="java-quote">"' '"</span> count=<span class="java-quote">"-1"</span> id=<span class="java-quote">"space"</span>/> <ww:append> <ww:param name=<span class="java-quote">"'source'"</span> value=<span class="java-quote">"#values"</span>/> <ww:param name=<span class="java-quote">"'source'"</span> value=<span class="java-quote">"#space"</span>/> <ww:subset count=<span class="java-quote">"6"</span>> <ww:iterator> <td width=<span class="java-quote">"40"</span>><ww:property/></td> </ww:iterator> </iterator:subset> </iterator:append> </tr> </ww:iterator> </ww:bean> </table></pre>
|
||||
</div></div><p class="paragraph"><a href="#Non-UITags-top" title="top on Non-UI Tags">返回</a><br/>
|
||||
<a name="Non-UITags-merge"></a>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Amerge%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:merge /></b></font></a></h3></p>将几个迭代器合并为一个. 该标签将这些迭代器交织在一起. If one iterator runs out, it will drop off and the others will continue weaving until there are no more values. <br/>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>属性 </th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>id</td><td>否</td><td>为元素指定唯一名称(<a href="#Non-UITags-Notes-Id" title="Notes-Id on Non-UI Tags">注意</a>).</td>
|
||||
</tr>
|
||||
</table><p class="paragraph">本例中, #foo, #bar, and #xyzzy被合并在一起. 因此, 输出顺序是foo, bar, xyzzy until #foo #xyzzy iterators run out in which case #bar will finish.</p><div class="code"><div class="codeContent">
|
||||
<pre>Three value generators with merge and subset limits:<br> <ww:generator val=<span class="java-quote">"'foo'"</span> count=<span class="java-quote">"5"</span> id=<span class="java-quote">"foo"</span>/> <ww:generator val=<span class="java-quote">"'bar'"</span> count=<span class="java-quote">"10"</span> id=<span class="java-quote">"bar"</span>/> <ww:generator val=<span class="java-quote">"'xyzzy'"</span> count=<span class="java-quote">"5"</span> id=<span class="java-quote">"xyzzy"</span>/> <ww:merge> <ww:param name=<span class="java-quote">"'source'"</span> value=<span class="java-quote">"#foo"</span>/> <ww:param name=<span class="java-quote">"'source'"</span> value=<span class="java-quote">"#bar"</span>/> <ww:param name=<span class="java-quote">"'source'"</span> value=<span class="java-quote">"#xyzzy"</span>/> <ww:subset count=<span class="java-quote">"30"</span>> <ww:iterator status=<span class="java-quote">"status"</span>> <ww:property value=<span class="java-quote">"#status.count"</span>/>:<ww:property/><br> </ww:iterator> </iterator:subset> </iterator:merge></pre>
|
||||
</div></div><p class="paragraph"><a href="#Non-UITags-top" title="top on Non-UI Tags">返回</a><br/>
|
||||
<a name="Non-UITags-sort"></a>
|
||||
<h3 class="heading3"><a name="Non-UITags-%3Cfontcolor%3D%22blue%22%3E%26lt%3Bww%3Asort%2F%26gt%3B%3C%2Ffont%3E"><font color="blue"><b class="strong"><ww:sort /></b></font></a></h3></p>Sort可以对一个迭代器进行排序. 它使用你提供的比较器(Comparator)进行比较, 使用Collections.sort()方法进行排序. <br/>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>属性 </th><th>必需</th><th>描述</th>
|
||||
</tr><tr>
|
||||
<td>id</td><td>否</td><td>为元素指定唯一名称(<a href="#Non-UITags-Notes-Id" title="Notes-Id on Non-UI Tags">注意</a>).</td>
|
||||
</tr><tr>
|
||||
<td>comparator</td><td><b class="strong">是</b></td><td>用于集合排序的Compartor. </td>
|
||||
</tr><tr>
|
||||
<td>source</td><td>否</td><td>指定本标签操作的迭代器.可以是Enumeration, Iterator, 或Collection. </td>
|
||||
</tr>
|
||||
</table><p class="paragraph">本例进行升序排序.</p><div class="code"><div class="codeContent">
|
||||
<pre><ww:bean name=<span class="java-quote">"'webwork.util.Counter'"</span> id=<span class="java-quote">"counter"</span>> <ww:param name=<span class="java-quote">"'first'"</span> value=<span class="java-quote">"0"</span>/> <ww:param name=<span class="java-quote">"'last'"</span> value=<span class="java-quote">"5"</span>/> </ww:bean> <ww:bean name=<span class="java-quote">"'webwork.util.Sorter'"</span> id=<span class="java-quote">"sorter"</span>/> Ascending:<br /> <ww:sort source=<span class="java-quote">"#counter"</span> comparator=<span class="java-quote">"#sorter.ascending"</span>> <ww:iterator> <ww:property/><br /> </ww:iterator> </iterator:sort></pre>
|
||||
</div></div><p class="paragraph">本例进行降序排序.</p><div class="code"><div class="codeContent">
|
||||
<pre><ww:bean name=<span class="java-quote">"'webwork.util.Sorter'"</span> id=<span class="java-quote">"sorter"</span>/> <ww:bean name=<span class="java-quote">"'webwork.util.Counter'"</span> id=<span class="java-quote">"counter"</span>> <ww:param name=<span class="java-quote">"'first'"</span> value=<span class="java-quote">"0"</span>/> <ww:param name=<span class="java-quote">"'last'"</span> value=<span class="java-quote">"5"</span>/> </ww:bean> Descending:<br> <ww:sort source=<span class="java-quote">"#counter"</span> comparator=<span class="java-quote">"#sorter.descending"</span>> <ww:iterator> <ww:property/><br> </ww:iterator> </iterator:sort></pre>
|
||||
</div></div><p class="paragraph">本例进行字符串升序排序.</p><div class="code"><div class="codeContent">
|
||||
<pre><ww:bean name=<span class="java-quote">"'webwork.util.Sorter'"</span> id=<span class="java-quote">"sorter"</span>/> Sorting strings:<br> <ww:generator val=<span class="java-quote">"'Rickard,Maurice,Hristo'"</span> separator=<span class="java-quote">"','"</span> id=<span class="java-quote">"names"</span>/> <ww:sort source=<span class="java-quote">"#names"</span> comparator=<span class="java-quote">"#sorter.ascending"</span>> <ww:iterator> <ww:property/><br> </ww:iterator> </iterator:sort></pre>
|
||||
</div></div><p class="paragraph"><h2 class="heading2"><a name="Non-UITags-Notes">注意</a></h2>
|
||||
<a name="Non-UITags-NotesId"></a><br/>
|
||||
<img class="rendericon" src="./icons/emoticons/information.png" height="16" width="16" align="absmiddle" alt="" border="0"/> <b class="strong">Id</b> 属性"id"为元素指定名字. 该名称在整个文档中必须是唯一的. 该属性是由TagSupport提供的, 因此永远是一个字符串. 不需要像其他WebWork标签那样使用字符串文法(string literal); 也就是说 - id="'age'". 你可以直接使用id="age".</p><a name="Non-UITags-NotesScope"></a><br/>
|
||||
<img class="rendericon" src="./icons/emoticons/information.png" height="16" width="16" align="absmiddle" alt="" border="0"/> 必需注意的是所有将某些值保存在值栈的标签(如i18n或bean)都将在标签结束时从值栈中将它们删除.<br/>
|
||||
因此, 如果你用bean标签实例化一个bean(<ww:bean name="'br.univap.fcc.sgpw.util.FormattersHelper'">), 该bean仅在</ww:bean>标签之前才能在值栈中访问.
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,57 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : OGNL基础</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : OGNL基础
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 17, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="OGNLBasics-XWorkspecificlanguagefeatures"> XWork特殊语言特性</a></h2>
|
||||
XWork基于OGNL并增加的最大功能是支持值栈. OGNL假定只有一个"根(root)", 而XWork值栈的概念支持多个"根".</p>例如, 假设我们使用标准OGNL(不用XWork), 在OgnlContext表中有两个对象: "foo" -> foo和"bar" -> bar, 并且foo被设置为<b class="strong">根</b>对象. 下列代码描述OGNL如何处理下列三种情况:<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>#foo.blah // returns foo.getBlah() #bar.blah // returns bar.getBlah() blah // returns foo.getBlah() because foo is the root</pre>
|
||||
</div></div><p class="paragraph">这意味着OGNL允许上下文中包含多个对象, 但除非你要访问的对象是根, 其他访问必须加上名空间如, @bar. 现在我们来讨论XWork的一点区别…</p>在XWork中, 整个值栈是上下文中的根对象. 但如果你向从栈中获取对象或是用它们的属性, 你并不需要针对值栈编写表达式(如: peek().blah), XWork有一个特殊的OGNL PropertyAccessor它将自动搜索整个值栈(自上而下)知道找到具有你要查找的属性的对象为止.<p class="paragraph">例如, 假设栈中有两个对象: Animal和Person. 来个对象都有"name"属性, Animal有一个"species"属性, Person有一个"salary"属性. Animal在栈顶, Person在它下面. 下面的代码片断有助于你了解会发生什么:</p><div class="code"><div class="codeContent">
|
||||
<pre>species // call to animal.getSpecies() salary // call to person.getSalary() name // call to animal.getName() because animal is on the top</pre>
|
||||
</div></div><p class="paragraph">在最后一个例子中, 两个对象都有name属性, 因此返回了animal的name. 通常这就是期望的效果, 但有时你需要使用低层对象的属性. 为此, XWork支持值栈索引. 你仅需要编写:</p><div class="code"><div class="codeContent">
|
||||
<pre>[0].name // call to animal.getName() [1].name // call to person.getName()</pre>
|
||||
</div></div><p class="paragraph"><h2 class="heading2"><a name="OGNLBasics-Accessingstaticproperties"> 访问静态属性</a></h2></p>OGNL支持对静态方法和属性的访问. 正如OGNL文档指出的, 可以使用下列代码显式调用静态内容:<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>@some.package.ClassName@FOO_PROPERTY @some.package.ClassName@someMethod()</pre>
|
||||
</div></div><p class="paragraph">然而, XWork不需要指定活动类的完整包名而是用"vs"前缀:</p><div class="code"><div class="codeContent">
|
||||
<pre>@vs@FOO_PROPERTY @vs@someMethod() @vs1@FOO_PROPERTY @vs1@someMethod() @vs2@BAR_PROPERTY @vs2@someOtherMethod()</pre>
|
||||
</div></div><p class="paragraph">"vs"就是"value stack". 需要注意的是如果你使用"vs"而不指定类名, 将使用栈顶对象类. 如果你在"vs"后增加数字, 将使用栈中更低层的对象.</p><h2 class="heading2"><a name="OGNLBasics-DifferencesfromtheWebWork1.xEL"> 与WebWork 1.x表达式语言的区别</a></h2>
|
||||
除了上面的例子和描述以外, 还有几个主要区别. 最大的区别是属性不再使用'/'访问而是用'.'. 另外, 不再使用".."向下遍历值栈, 目前使用"[n]", n是一个数字. 最后, 在WebWork 1.x中可以使用"@foo"访问特殊命名对象, 但现在特殊变量使用"#foo"访问. 无论如何, 最重要的是"#foo"不能访问请求属性. 因为XWork不仅是为Web而创建, 因此没有"请求属性"的概念, 因此"#foo"仅仅是请求OgnlContext中非根对象的表达式.<br/>
|
||||
|
||||
<table class="wiki-table" cellpadding="0" cellspacing="0" border="0"><tr><th>Old Expression</th><th>New Expression</th></tr><tr class="table-odd"><td>foo/blah</td><td>foo.blah</td></tr><tr class="table-even"><td>foo/someMethod()</td><td>foo.someMethod()</td></tr><tr class="table-odd"><td>../bar/blah</td><td>[1].bar.blah</td></tr><tr class="table-even"><td>@baz</td><td>不直接支持1, 但#baz与之类似</td></tr><tr class="table-odd"><td>.</td><td>top or [0]</td></tr></table>
|
||||
<h2 class="heading2"><a name="OGNLBasics-WebWorkspecificnamedobjects"> WebWork的特殊命名对象</a></h2>
|
||||
<table class="wiki-table" cellpadding="0" cellspacing="0" border="0"><tr><th>名字</th><th>值</th></tr><tr class="table-odd"><td>#parameters['foo'] or #parameters.foo</td><td>request parameter ['foo'] (request.getParameter())</td></tr><tr class="table-even"><td>#request['foo'] or #request.foo</td><td>request attribute ['foo'] (request.getAttribute())</td></tr><tr class="table-odd"><td>#session['foo'] or #session.foo</td><td>session attribute 'foo'</td></tr><tr class="table-even"><td>#application['foo'] or #application.foo</td><td>ServletContext attributes 'foo'</td></tr><tr class="table-odd"><td>#attr['foo'] or #attr.foo</td><td>Access to PageContext if available, otherwise searches request/session/application respectively</td></tr></table>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,83 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : OGNL</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : OGNL
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="OGNL-Overview"> 综述</a></h2></p>OGNL就是Object Graph Navigation Language - 请访问<a href="http://www.ognl.org" title="Visit page outside Confluence">http://www.ognl.org</a>查看OGNL完整文档. 本文中我们仅展示几个与WebWork共存的OGNL特性.
|
||||
<ul class="star">
|
||||
<li> 要回顾基本概念, 参考<a href="OGNL Basics.html" title="OGNL Basics">OGNL基础</a></li>
|
||||
</ul>
|
||||
<h4 class="heading4"><a name="OGNL-WebworkwithOGNL"> Webwork和OGNL</a></h4><p class="paragraph">Webwork使用标准命名上下文(namming context)运算OGNL表达式. OGNL处理的定级对象是一个map(通常被称为context map). OGNL有一个根对象的概念 (在webwork术语中, 就是OGNLValueStack). 其他对象和根对象一起放置在context map(简称context)中, 包括session/application/request属性. 这些对象和根对象没有关系, 只是顺序存在于context map中. 因此, 为访问这些对象需要 使用#告诉ognl不要在根对象中查找, 而应当在其他context中查找
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>| |--request | |--application | context map---|--OgnlValueStack(root) | |--session | |--attr | |--parameters</pre>
|
||||
</div></div></p>N注意context map中还有其他对象, 本例中仅引用了一部分. 现在, 活动对象被放入OGNLValueStack因此可以不使用#访问它的属性.
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww: property value=<span class="xml-quote">"myBean.myProperty"</span>/></span></pre>
|
||||
</div></div><p class="paragraph">要访问session, request和其他对象:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>ActionContext.getContext().getSession().put(<span class="java-quote">"mySessionPropKey"</span>, mySessionObject);</pre>
|
||||
</div></div>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww: property value=<span class="xml-quote">"#session.mySessionPropKey"</span>/></span> or <span class="xml-tag"><ww: property value=<span class="xml-quote">"#session['mySessionPropKey']"</span>/></span> <span class="xml-tag"><ww: property value=<span class="xml-quote">"#attr.mySessionPropKey"</span>/></span></pre>
|
||||
</div></div></p><h4 class="heading4"><a name="OGNL-Collections%28Maps%2CLists%2CSets%29"> 集合 (Maps, Lists, Sets) </a></h4>
|
||||
在WebWork中经常要处理集合(maps, lists, sets), 因此下面是几个使用select标签的例子:<br/>
|
||||
list的语法: {e1,e2}. 它创建一个List, 包含字符串"name1"和"name2".
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><webwork:select label=<span class="xml-quote">"'lebal'"</span> name=<span class="xml-quote">"'nmae'"</span> list=<span class="xml-quote">"{'name1','name2'}"</span> /></span></pre>
|
||||
</div></div><br/>
|
||||
map的语法: #{key1:value1,key2:value2}. 它创建一个Map, 将"foo"映射到"foovalue", "bar"映射到"barvalue":
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><webwork:select label=<span class="xml-quote">"'lebal'"</span> name=<span class="xml-quote">"'nmae'"</span> list=<span class="xml-quote">"#{'foo':'foovalue', 'bar':'barvalue'}"</span> /></span></pre>
|
||||
</div></div><p class="paragraph">有时需要判断一个元素是否包含在集合中. 可以使用下面的操作<tt class="monospaced">in</tt>和<tt class="monospaced">not in</tt>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ui:if test=<span class="xml-quote">"'foo' in {'foo','bar'}"</span>></span> muhahaha <span class="xml-tag"></ui:if></span> <span class="xml-tag"><ui:else></span> boo <span class="xml-tag"></ui:else></span> <span class="xml-tag"><ui:if test=<span class="xml-quote">"'foo' not in {'foo','bar'}"</span>></span> muhahaha <span class="xml-tag"></ui:if></span> <span class="xml-tag"><ui:else></span> boo <span class="xml-tag"></ui:else></span></pre>
|
||||
</div></div></p>选择集合的一个子集(称为投影), 可以在集合中使用通佩符(wildcard).
|
||||
<ul type="square" class="minus">
|
||||
<li> ? - 所有匹配选择逻辑的元素</li>
|
||||
<li> ^ - 第一个匹配选择逻辑的元素</li>
|
||||
<li> $ - 最后一个匹配选择逻辑的元素</li>
|
||||
</ul><br/>
|
||||
从对象Person中获取男性亲属的子集:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>person.relatives.{? #this.gender == 'male'}</pre>
|
||||
</div></div><p class="paragraph"><h4 class="heading4"><a name="OGNL-LambdaExpressions"> Lambda表达式 </a></h4>
|
||||
OGNL支持基本的lamba表达式语法可以用来编写简单的函数.</p>例如:<p class="paragraph">你可能不会想到会在数学课外在见到这个.<br/>
|
||||
菲波纳切(Fibonacci)数列: if n==0 return 0; elseif n==1 return 1; else return fib(n-2)+fib(n-1);<br/>
|
||||
fib(0) = 0<br/>
|
||||
fib(1) = 1<br/>
|
||||
fib(11) = 89</p>Lambda表达式的任何内容都包括在括号中. #this变量保存表达式的参数, 它的初始值是11.<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww:property value=<span class="xml-quote">"#fib =:[#this==0 ? 0 : #this==1 ? 1 : #fib(#this-2)+#fib(#this-1)], #fib(11)"</span> /></span></pre>
|
||||
</div></div>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,83 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Password标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Password标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="Passwordtag-%26lt%3Bww%3Apassword%2F%26gt%3B"> <ww:password /> </a></h3></p>类型为password的INPUT标签.<p class="paragraph">本例中显示一个password控件. 通过调用ActionSupport的getText()方法从ResourceBundle中提取文本作为其标签.
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww:password label=<span class="xml-quote">"text('password')"</span> name=<span class="xml-quote">"'password'"</span> size=<span class="xml-quote">"10"</span> maxlength=<span class="xml-quote">"15"</span>/></span></pre>
|
||||
</div></div></p><b class="strong">属性</b>
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th> 名字 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> id </td><td> 否 </td><td> HTML的id属性 </td>
|
||||
</tr><tr>
|
||||
<td> name </td><td> <b class="strong">是</b> </td><td> HTML的name属性 </td>
|
||||
</tr><tr>
|
||||
<td> value </td><td> 否 </td><td> 文本值 </td>
|
||||
</tr><tr>
|
||||
<td> size </td><td> 否 </td><td> HTML的size属性</td>
|
||||
</tr><tr>
|
||||
<td> maxlength </td><td> 否 </td><td> HTML的maxlength属性 </td>
|
||||
</tr><tr>
|
||||
<td> disabled </td><td> 否 </td><td> HTML的disabled属性 </td>
|
||||
</tr><tr>
|
||||
<td> readonly </td><td> 否 </td><td> HTML的readonly属性</td>
|
||||
</tr><tr>
|
||||
<td> onkeyup </td><td> 否 </td><td> HTML的onkeyup属性</td>
|
||||
</tr><tr>
|
||||
<td> tabindex </td><td> 否 </td><td> HTML的tabindex属性</td>
|
||||
</tr><tr>
|
||||
<td> onchange </td><td> 否 </td><td> HTML的onchange属性 </td>
|
||||
</tr><tr>
|
||||
<td> onclick </td><td> 否 </td><td> HTML的onclick属性 </td>
|
||||
</tr><tr>
|
||||
<td> show </td><td> 否 </td><td> 是否显示密码值(涉及安全性) </td>
|
||||
</tr><tr>
|
||||
<td> label </td><td> 否 </td><td> 用于模版中的标签文字 </td>
|
||||
</tr><tr>
|
||||
<td> labelposition </td><td> 否 </td><td> 标签的对齐方式 (left,right,center) </td>
|
||||
</tr><tr>
|
||||
<td> required </td><td> 否 </td><td> 在表单提交时是否是必需字段 </td>
|
||||
</tr><tr>
|
||||
<td> cssClass </td><td> 否 </td><td> HTML的class属性 </td>
|
||||
</tr><tr>
|
||||
<td> cssStyle </td><td> 否 </td><td> HTML的style属性 </td>
|
||||
</tr><tr>
|
||||
<td> theme </td><td> 否 </td><td> 使用的主题 </td>
|
||||
</tr><tr>
|
||||
<td> template </td><td> 否 </td><td> 使用的模版名 </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,36 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Pico</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Pico
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Jun 18, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">Pico is an Inversion of Control container available at <a href="http://picocontainer.codehaus.org." title="Visit page outside Confluence">http://picocontainer.codehaus.org.</a> There have been several reports of integration between WebWork and Pico. We recommend that you build your own ObjectFactory to do this integration.</p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,63 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Previous releases</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Previous releases
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<ul class="star">
|
||||
<li> Release Notes<ul class="star">
|
||||
<li> <a href="WebWork 2.1.7.html" title="WebWork 2.1.7">WebWork 2.1.7</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h3 class="heading3"><a name="Previousreleases-Oldformatofreleasenotesandupgradeguides"> Old format of release notes and upgrade guides</a></h3>
|
||||
|
||||
<ul class="star">
|
||||
<li> Release Notes<ul class="star">
|
||||
<li> <a href="Release Notes - 2.1.6.html" title="Release Notes - 2.1.6">Release Notes - 2.1.6</a></li>
|
||||
<li> <a href="Release Notes - 2.1.5.html" title="Release Notes - 2.1.5">Release Notes - 2.1.5</a></li>
|
||||
<li> <a href="Release Notes - 2.1.4.html" title="Release Notes - 2.1.4">Release Notes - 2.1.4</a></li>
|
||||
<li> <a href="Release Notes - 2.1.3.html" title="Release Notes - 2.1.3">Release Notes - 2.1.3</a></li>
|
||||
<li> <a href="Release Notes - 2.1.2.html" title="Release Notes - 2.1.2">Release Notes - 2.1.2</a></li>
|
||||
<li> <a href="Release Notes - 2.1.1.html" title="Release Notes - 2.1.1">Release Notes - 2.1.1</a></li>
|
||||
<li> <a href="Release Notes - 2.1.html" title="Release Notes - 2.1">Release Notes - 2.1</a></li>
|
||||
</ul></li>
|
||||
<li> Upgrading from previous versions<ul class="star">
|
||||
<li> <a href="Upgrading from 2.1.5.html" title="Upgrading from 2.1.5">Upgrading from 2.1.5</a></li>
|
||||
<li> <a href="Upgrading from 2.1.4.html" title="Upgrading from 2.1.4">Upgrading from 2.1.4</a></li>
|
||||
<li> <a href="Upgrading from 2.1.3.html" title="Upgrading from 2.1.3">Upgrading from 2.1.3</a></li>
|
||||
<li> <a href="Upgrading from 2.1.2.html" title="Upgrading from 2.1.2">Upgrading from 2.1.2</a></li>
|
||||
<li> <a href="Upgrading from 2.1.1.html" title="Upgrading from 2.1.1">Upgrading from 2.1.1</a></li>
|
||||
<li> <a href="Upgrading from 2.1.html" title="Upgrading from 2.1">Upgrading from 2.1</a></li>
|
||||
<li> <a href="Upgrading from 2.0.html" title="Upgrading from 2.0">Upgrading from 2.0</a></li>
|
||||
<li> <a href="Upgrading from 1.4.html" title="Upgrading from 1.4">Upgrading from 1.4</a></li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,68 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Projects Using WebWork</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Projects Using WebWork
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 17, 2004 by <font color="#0050B2">mcampbell</font>.
|
||||
</div>
|
||||
|
||||
<ul class="star">
|
||||
<li> <a href="http://www.atlassian.com/software/confluence/default.jsp" title="Visit page outside Confluence"> Atlassian Confluence</a> - Commercial Wiki and knowledge management system using WebWork 2.0, Hibernate, Spring, and Velocity</li>
|
||||
</ul>
|
||||
<ul class="star">
|
||||
<li> <a href="http://www.chemistaustralia.com.au" title="Visit page outside Confluence"> Chemist Australia</a> - Online Pharmacy</li>
|
||||
</ul>
|
||||
<ul class="star">
|
||||
<li> <a href="http://www.drivenow.com.au" title="Visit page outside Confluence"> DriveNow</a> - last minute Autralian car rentals</li>
|
||||
</ul>
|
||||
<ul class="star">
|
||||
<li> <a href="http://www.opensourcesoft.net" title="Visit page outside Confluence"> OpenReports</a> - an open source web based reporting application that uses WebWork 2.0, Velocity, and Hibernate</li>
|
||||
</ul>
|
||||
<ul class="star">
|
||||
<li> <a href="http://www.esagegroup.com" title="Visit page outside Confluence">eSage Group</a> is a consulting company that uses it for all their client engagements. Additionally, its used for their internal systems</li>
|
||||
</ul>
|
||||
<ul class="star">
|
||||
<li> <a href="http://filmweb.pl" title="Visit page outside Confluence"> Filmweb</a> - Polish Film Portal</li>
|
||||
</ul>
|
||||
<ul class="star">
|
||||
<li> <a href="http://www.teramedica.com" title="Visit page outside Confluence"> TeraMEDICA</a> - WebWork is used in TeraMEDICA's commercial TI2m product, which performs intelligent image management for the healthcare enterprise. Specifically, WebWork is a key component of the system's management interface.</li>
|
||||
</ul>
|
||||
<ul class="star">
|
||||
<li> <a href="http://www.ebia.com" title="Visit page outside Confluence">EBIA COBRA and 401K Benefits Site</a> provides law reviews for employee benefits like COBRA and 401K. The site moved from all struts to a current architecture of about 50% WebWork and 50% Struts. We are trying to move it all over to WebWork. This site is also a great example of porting from Tiles to SiteMesh.</li>
|
||||
</ul>
|
||||
<ul class="star">
|
||||
<li> <a href="http://www.jieesoft.com/midwinter" title="Visit page outside Confluence"> Midwinter</a> - an open source rapid web application develop system using WebWork 2.0, Hibernate, Spring, and Velocity</li>
|
||||
</ul>
|
||||
<ul class="star">
|
||||
<li> <a href="http://rolecall.valtira.com/" title="Visit page outside Confluence"> Valtira Rolecall</a> - Identity Management Framework that provides single sign-on for J2EE and .NET web applications.</li>
|
||||
</ul>
|
||||
<ul class="star">
|
||||
<li> <a href="http://www.orange-blossom.com" title="Visit page outside Confluence"> Orange Blossom Indian River Citrus</a> - Retail site of shipper of fresh Florida (USA) citrus.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,45 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Quartz</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Quartz
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Jun 10, 2004 by <font color="#0050B2">ctran</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">The following class performs the glue between Quartz and Webwork:</p><div class="code"><div class="codeContent">
|
||||
<pre><span class="java-keyword">package</span> com.trantek.sit.action; <span class="java-keyword">import</span> com.opensymphony.xwork.ActionProxy; <span class="java-keyword">import</span> com.opensymphony.xwork.ActionProxyFactory; <span class="java-keyword">import</span> org.quartz.Job; <span class="java-keyword">import</span> org.quartz.JobExecutionContext; <span class="java-keyword">import</span> org.quartz.JobExecutionException; <span class="java-keyword">public</span> class WebWorkJob <span class="java-keyword">implements</span> Job { <span class="java-keyword">public</span> void execute(JobExecutionContext context) <span class="java-keyword">throws</span> JobExecutionException { <span class="java-keyword">try</span> { ActionProxy proxy = ActionProxyFactory.getFactory(). createActionProxy("", context.getJobDetail().getName(), context.getJobDetail().getJobDataMap()); proxy.execute(); } <span class="java-keyword">catch</span> (Exception e) { <span class="java-keyword">throw</span> <span class="java-keyword">new</span> JobExecutionException(e); } } }</pre>
|
||||
</div></div><p class="paragraph">To schedule webwork actions you simply create a job where</p><ul class="star">
|
||||
<li> the name of your job is the name of the WW action to execute (no ".action" suffix).</li>
|
||||
<li> all the parameters you want to send to the WW action is contained in the JobDataMap of the JobDetail</li>
|
||||
</ul><p class="paragraph">(the Quartz scheduler is setup as a servlet according to the javadocs of org.quartz.ee.servlet.QuartzInitializerServlet.)</p>The following code schedules an e-mail action:<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler(); JobDetail jobDetail = <span class="java-keyword">new</span> JobDetail(<span class="java-quote">"email.send"</span>, scheduler.DEFAULT_GROUP, WebworkJob.class); Map m = jobDetail.getJobDataMap(); m.put(<span class="java-quote">"to"</span>, <span class="java-quote">"me@bogusdomain.com"</span>); m.put(<span class="java-quote">"subject"</span>, <span class="java-quote">"quartz test"</span>); m.put(<span class="java-quote">"body"</span>, <span class="java-quote">"This is a quartz test, Hey ho"</span>); m.put(<span class="java-quote">"smtpServer"</span>, <span class="java-quote">"smtp.bogusdomain.com"</span>); m.put(<span class="java-quote">"from"</span>, <span class="java-quote">"quartz@bogusdomain.com"</span>); SimpleTrigger trigger = <span class="java-keyword">new</span> SimpleTrigger(<span class="java-quote">"myTrigger"</span>, scheduler.DEFAULT_GROUP, <span class="java-keyword">new</span> Date(), <span class="java-keyword">null</span>, 0, 0L); scheduler.deleteJob(<span class="java-quote">"email.send"</span>, scheduler.DEFAULT_GROUP); scheduler.scheduleJob(jobDetail, trigger);</pre>
|
||||
</div></div><p class="paragraph">This example is based on <a href="http://wiki.opensymphony.com//display/WW1/Integrating+Webwork+and+Quartz" title="Integrating Webwork and Quartz">WW1:Integrating Webwork and Quartz</a></p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,113 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : QuickStart</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : QuickStart
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Nov 08, 2004 by <font color="#0050B2">matthew</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">WebWork is a popular, easy-to-use MVC framework, for more information on the WebWork project, please visit <a href="WebWork.html" title="WebWork">WW:WebWork</a>. This guide should be helpful to seasoned Java developers with previous experience in MVC frameworks. We will briefly cover the three main components on a WebWork2 based application, the configuration the action classes, and the views.</p><h2 class="heading2"><a name="QuickStart-GETTINGSTARTED"> GETTING STARTED</a></h2>
|
||||
To use WebWork as your framework for writing Java-based web applications, you need to start by installing the various libraries (these are all available in the <a href="https://webwork.dev.java.net/servlets/ProjectDocumentList" title="Visit page outside Confluence">webwork 2.x distribution</a>):<p class="paragraph"><h3 class="heading3"><a name="QuickStart-CoreJARfiles"> Core JAR files</a></h3>
|
||||
<ul class="star">
|
||||
<li> <a href="https://webwork.dev.java.net/servlets/ProjectDocumentList" title="Visit page outside Confluence">webwork-2.1.5.jar</a></li>
|
||||
<li> <a href="https://xwork.dev.java.net/servlets/ProjectDocumentList" title="Visit page outside Confluence">xwork-1.0.3.jar</a></li>
|
||||
<li> ognl-2.6.5.jar</li>
|
||||
<li> commons-logging.jar</li>
|
||||
<li> oscore-2.2.4.jar</li>
|
||||
<li> velocity-dep-1.3.1.jar</li>
|
||||
</ul>
|
||||
<h3 class="heading3"><a name="QuickStart-OptionalJARfiles"> Optional JAR files</a></h3>
|
||||
<ul class="star">
|
||||
<li> jstl.jar (needed for Standard Tag Libraries)</li>
|
||||
<li> cos-multipart.jar</li>
|
||||
<li> pell-multipart.jar</li>
|
||||
<li> standard.jar</li>
|
||||
<li> mail.jar</li>
|
||||
</ul>
|
||||
<h2 class="heading2"><a name="QuickStart-CONFIGURATION"> CONFIGURATION</a></h2>
|
||||
WebWork is built upon the Xwork framework. Xwork handles the translation requests to commands execution, but let's not worry about that right now. You need to know this information in case you were curious about the xwork JAR file, and if you want to learn some of the more advanced features of the WebWork command structure, you can visit the <a href="http://wiki.opensymphony.com//display/XW/XWork" title="XWork">XW:XWork</a> site.</p><h3 class="heading3"><a name="QuickStart-Exampleweb.xmlfile"> Example web.xml file</a></h3>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><?xml version=<span class="xml-quote">"1.0"</span> encoding=<span class="xml-quote">"ISO-8859-1"</span>?></span> <span class="xml-tag"><!DOCTYPE web-app PUBLIC <span class="xml-quote">"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"</span> <span class="xml-quote">"http://java.sun.com/dtd/web-app_2_3.dtd"</span>></span> <span class="xml-tag"><web-app></span> <span class="xml-tag"><display-name></span>WebWork 2.0 Quick Start<span class="xml-tag"></display-name></span> <span class="xml-tag"><servlet></span> <span class="xml-tag"><servlet-name></span>webwork<span class="xml-tag"></servlet-name></span> <span class="xml-tag"><servlet-class></span>com.opensymphony.webwork.dispatcher.ServletDispatcher<span class="xml-tag"></servlet-class></span> <span class="xml-tag"></servlet></span> <span class="xml-tag"><servlet-mapping></span> <span class="xml-tag"><servlet-name></span>webwork<span class="xml-tag"></servlet-name></span> <span class="xml-tag"><url-pattern></span>*.action<span class="xml-tag"></url-pattern></span> <span class="xml-tag"></servlet-mapping></span> <span class="xml-tag"><welcome-file-list></span> <span class="xml-tag"><welcome-file></span>index.jsp<span class="xml-tag"></welcome-file></span> <span class="xml-tag"><welcome-file></span>index.html<span class="xml-tag"></welcome-file></span> <span class="xml-tag"></welcome-file-list></span> <span class="xml-tag"><taglib></span> <span class="xml-tag"><taglib-uri></span>webwork<span class="xml-tag"></taglib-uri></span> <span class="xml-tag"><taglib-location></span>/WEB-INF/lib/webwork-2.1.5.jar<span class="xml-tag"></taglib-location></span> <span class="xml-tag"></taglib></span> <span class="xml-tag"></web-app></span></pre>
|
||||
</div></div><p class="paragraph"><h3 class="heading3"><a name="QuickStart-Servletmappings"> Servlet mappings</a></h3>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><servlet-mapping></span> <span class="xml-tag"><servlet-name></span>webwork<span class="xml-tag"></servlet-name></span> <span class="xml-tag"><url-pattern></span>*.action<span class="xml-tag"></url-pattern></span> <span class="xml-tag"></servlet-mapping></span></pre>
|
||||
</div></div><br/>
|
||||
The above section will map ANY servlet called with an extension of <b class="strong">.action</b> to the WebWork base servlet, and assume it is a WebWork action class.</p><h3 class="heading3"><a name="QuickStart-Taglibs"> Taglibs</a></h3>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><taglib></span> <span class="xml-tag"><taglib-uri></span>webwork<span class="xml-tag"></taglib-uri></span> <span class="xml-tag"><taglib-location></span>/WEB-INF/lib/webwork-2.1.5.jar<span class="xml-tag"></taglib-location></span> <span class="xml-tag"></taglib></span></pre>
|
||||
</div></div><br/>
|
||||
The above section will load the standard WebWork tag libraries. This is required for JSP 1.1 compatible containers. To load more or different libraries, add more <b class="strong"><taglib></b> calls.<p class="paragraph"><h3 class="heading3"><a name="QuickStart-ExampleXworkconfigfile%28xwork.xml%29"> Example Xwork config file (xwork.xml)</a></h3>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><?xml version=<span class="xml-quote">"1.0"</span> encoding=<span class="xml-quote">"ISO-8859-1"</span>?></span> <span class="xml-tag"><!DOCTYPE xwork PUBLIC <span class="xml-quote">"-//OpenSymphony Group//XWork 1.0//EN"</span> <span class="xml-quote">"http://www.opensymphony.com/xwork/xwork-1.0.dtd"</span>></span> <span class="xml-tag"><xwork></span> <span class="xml-tag"><include file=<span class="xml-quote">"webwork-default.xml"</span>/></span> <span class="xml-tag"><package name=<span class="xml-quote">"default"</span> extends=<span class="xml-quote">"webwork-default"</span>></span> <span class="xml-tag"><interceptors></span> <span class="xml-tag"><interceptor name=<span class="xml-quote">"security"</span> class=<span class="xml-quote">"com.acme.LoginCheck"</span>/></span> <span class="xml-tag"><interceptor-ref name=<span class="xml-quote">"defaultStack"</span>/></span> <span class="xml-tag"></interceptors></span> <span class="xml-tag"><default-interceptor-ref name=<span class="xml-quote">"security"</span>/></span> <span class="xml-tag"><action name=<span class="xml-quote">"showForm"</span> class=<span class="xml-quote">"com.acme.FormAction"</span>></span> <span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"dispatcher"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"location"</span>></span>/form.jsp<span class="xml-tag"></param></span> <span class="xml-tag"></result></span> <span class="xml-tag"></action></span> <span class="xml-tag"><action name=<span class="xml-quote">"saveForm"</span> class=<span class="xml-quote">"com.acme.FormAction"</span> method=<span class="xml-quote">"processForm"</span>></span> <span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"dispatcher"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"location"</span>></span>/form.jsp<span class="xml-tag"></param></span> <span class="xml-tag"></result></span> <span class="xml-tag"><result name=<span class="xml-quote">"missing-data"</span> type=<span class="xml-quote">"dispatcher"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"location"</span>></span>/form.jsp<span class="xml-tag"></param></span> <span class="xml-tag"></result></span> <span class="xml-tag"><interceptor-ref name=<span class="xml-quote">"security"</span>/></span> <span class="xml-tag"></action></span> <span class="xml-tag"></package></span> <span class="xml-tag"></xwork></span></pre>
|
||||
</div></div></p><h2 class="heading2"><a name="QuickStart-ACTIONS"> ACTIONS</a></h2>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><action name=<span class="xml-quote">"saveForm"</span> class=<span class="xml-quote">"com.acme.FormAction"</span> method=<span class="xml-quote">"processForm"</span>></span></pre>
|
||||
</div></div><p class="paragraph">Actions are the basic "unit-of-work" in WebWork, they define, well, actions. An action will usually be a request, (and usually a button click, or form submit). The main action element (tag is too synonymous with JSP) has two parts, the friendly name (referenced in the URL, i.e. <b class="strong">saveForm.action</b>) and the corresponding "handler" class.</p>The method parameter tells WebWork which method to call based upon this action. If you leave the method parameter blank, WebWork will call the method <b class="strong">execute()</b> from the Action Interface by default. Since every Action must implment the Action Interface, this method will always be available.<p class="paragraph"><h2 class="heading2"><a name="QuickStart-RESULTS"> RESULTS</a></h2>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><result name=<span class="xml-quote">"missing-data"</span> type=<span class="xml-quote">"dispatcher"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"location"</span>></span>/form.jsp<span class="xml-tag"></param></span> <span class="xml-tag"></result></span></pre>
|
||||
</div></div></p>Result tags tell WebWork what to do next after the action has been called. There are a standard set of result codes built-in to WebWork, (in the Action interface) they include:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="java-object">String</span> SUCCESS = <span class="java-quote">"success"</span>; <span class="java-object">String</span> NONE = <span class="java-quote">"none"</span>; <span class="java-object">String</span> ERROR = <span class="java-quote">"error"</span>; <span class="java-object">String</span> INPUT = <span class="java-quote">"input"</span>; <span class="java-object">String</span> LOGIN = <span class="java-quote">"login"</span>;</pre>
|
||||
</div></div><p class="paragraph">You can extend these as you see fit. Most of the time you will have either <b class="strong">SUCCESS</b> or <b class="strong">ERROR</b>, with <b class="strong">SUCCESS</b> moving on to the next page in your application;
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"dispatcher"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"location"</span>></span>/thank_you.jsp<span class="xml-tag"></param></span> <span class="xml-tag"></result></span></pre>
|
||||
</div></div></p>…and <b class="strong">ERROR</b> moving on to an error page, or the preceding page;
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><result name=<span class="xml-quote">"error"</span> type=<span class="xml-quote">"dispatcher"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"location"</span>></span>/error.jsp<span class="xml-tag"></param></span> <span class="xml-tag"></result></span></pre>
|
||||
</div></div><p class="paragraph">You can stack as many result tags within a single action tag as you wish.</p>For further reading on Result types, see <a href="Result Types.html" title="Result Types">WW:Result Types</a>.
|
||||
<p class="paragraph"><h2 class="heading2"><a name="QuickStart-INTERCEPTORS"> INTERCEPTORS</a></h2>
|
||||
Interceptors allow you to define code to be executed before and/or after the execution of an action. Interceptors can be a powerful tool when writing web applications. Some of the most common implementations of an Interceptor might be:</p><ul class="star">
|
||||
<li> Security Checking (ensuring the user is logged in)</li>
|
||||
<li> Trace Logging (logging every action)</li>
|
||||
<li> Bottleneck Checking (start a timer before and after every action, to check bottlenecks in your application)</li>
|
||||
</ul><br/>
|
||||
You can also group Interceptors together to create "stacks". If you wanted to do a login check, security check, and logging all before an Action call, this could easily be done with an interceptor stack.<p class="paragraph">For further Reading on Interceptors, see <a href="http://wiki.opensymphony.com//display/XW/Interceptors" title="Interceptors">XW:Interceptors</a><br clear="all" />
|
||||
For further Reading on Xwork configuration files, see <a href="http://wiki.opensymphony.com//display/XW/Configuration" title="Configuration">XW:Configuration</a></p><h2 class="heading2"><a name="QuickStart-ACTIONCLASSES"> ACTION CLASSES</a></h2>
|
||||
The action classes do what they say, they handle the action. They are called by the actions specified in the <b class="strong">xwork.xml</b> file and initiated by the user in the "views". To turn your class into an action class, you simply need to extend the class <b class="strong">ActionSupport</b> or implement the <b class="strong">Action</b> interface. <p class="paragraph">Here is what our <b class="strong">saveForm</b> action looks like in its Java form (NOTE: If you look in the <b class="strong">xwork.xml</b> file above, we've overridden the action to call the <b class="strong">processForm</b> method):</p><div class="code"><div class="codeContent">
|
||||
<pre><span class="java-keyword">package</span> com.acme; <span class="java-keyword">import</span> com.opensymphony.xwork.*; <span class="java-keyword">public</span> class FormAction <span class="java-keyword">extends</span> ActionSupport { <span class="java-keyword">private</span> FormBean myFormBean = <span class="java-keyword">new</span> FormBean(); <span class="java-keyword">public</span> void setFormBean(FormBean inBean) { myFormBean = inBean; } <span class="java-keyword">public</span> FormBean getFormBean() { <span class="java-keyword">return</span> myFormBean; } <span class="java-keyword">public</span> <span class="java-object">String</span> processForm() { FormParameters formParams = <span class="java-keyword">this</span>.getFormBean(); checkBizRules(formParams); <span class="java-keyword">this</span>.saveParamsToDb(formParams); <span class="java-keyword">return</span> SUCCESS; } ... }</pre>
|
||||
</div></div><p class="paragraph"><h2 class="heading2"><a name="QuickStart-VIEWS"> VIEWS</a></h2>
|
||||
WebWork supports JSP, Velocity, and FreeMarker for your application presentation layer. For this example, we will use a JSP file. The appropriate presentation layer is denoted by the result type specified. For JSPs, the result type is the name mapped to the <b class="strong">com.opensymphony.webwork.dispatcher.ServletDispatcherResult</b>. Typically, this is "dispatcher".</p>WebWork comes packaged with a tag library (taglibs). You can use these taglibs as components in your JSP file. Here is an section of our <b class="strong">form.jsp</b> page:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><%@ taglib prefix=<span class="java-quote">"ww"</span> uri=<span class="java-quote">"webwork"</span> %> <html> <head><title>Webwork Form Example</title></head> <body> <ww:form name=<span class="java-quote">"'myForm'"</span> action=<span class="java-quote">"'saveForm.action'"</span> method=<span class="java-quote">"'POST'"</span>> <table> <ww:textfield label=<span class="java-quote">"'First Name'"</span> name=<span class="java-quote">"'formBean.firstName'"</span> value=<span class="java-quote">"formBean.firstName"</span>/> <ww:textfield label=<span class="java-quote">"'Last Name'"</span> name=<span class="java-quote">"'formBean.lastName'"</span> value=<span class="java-quote">"formBean.lastName"</span>/> </table> <input type=<span class="java-quote">"submit"</span> value=<span class="java-quote">"Save Form"</span>/> </ww:form> </body></pre>
|
||||
</div></div><p class="paragraph">The process of events will go as follows:
|
||||
<ol>
|
||||
<li> WebWork will take notice since the URI ends in <b class="strong">.action</b> (defined in our <b class="strong">web.xml</b> files)</li>
|
||||
<li> WebWork will look up the action <b class="strong">saveForm</b> in its action hierarchy and call any Interceptors that we might have defined.</li>
|
||||
<li> WebWork will translate <b class="strong">saveForm</b> and decide we would like to call the method <b class="strong">processForm</b> in our class <b class="strong">com.acme.FormAction</b> as defined in our <b class="strong">xwork.xml</b> file.</li>
|
||||
<li> Our method will process successfully and give WebWork the <b class="strong">SUCCESS</b> return parameter.</li>
|
||||
<li> WebWork will translate the <b class="strong">SUCCESS</b> return parameter into the location <b class="strong">thank_you.jsp</b> (as defined in <b class="strong">xwork.xml</b>) and redirect us accordingly.</li>
|
||||
</ol>
|
||||
<h2 class="heading2"><a name="QuickStart-SUMMARY"> SUMMARY</a></h2>
|
||||
The purpose of this guide is to provide the user with a quick-and-dirty understanding of WebWork2. I hope we successfully briefed you on the three most important components of any WebWork based application, the configuration (including <b class="strong">web.xml</b> and <b class="strong">xwork.xml</b>), the action classes, and the views. This information should give you a starting point to experiment and become more familiar with the rising star of the open source, Model2, web frameworks.</p><h2 class="heading2"><a name="QuickStart-MiscellaneousNotes"> Miscellaneous Notes</a></h2>
|
||||
It is not necessary to map and load the WebWorkVelocityServlet in in the <b class="strong">web.xml</b> in order to use Velocity rendered pages. WebWork includes a built-in Velocity result type. Using the result type should be faster than sending the result to the servlet dispatcher which then delegates to the servlet mapping for WebWorkVelocityServlet.
|
||||
<p class="paragraph">Originally by:<br/>
|
||||
Matt Dowell<br clear="all" />
|
||||
matt.dowell@notiva.com<br clear="all" />
|
||||
September 15, 2003</p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,80 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Radio标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Radio标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="Radiotag-%26lt%3Bww%3Aradio%2F%26gt%3B"> <ww:radio /></a></h3></p>一个HTML单选按钮UI组件<p class="paragraph">本例中, 一个数据列表被绘制成一组单选按钮. The gender list is built from attribute 根据属性id=genders建立性别列表. WebWork调用getGenders()方法, 该方法返回一个Map.listKey和listValue属性的用法参见select标签.
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww:action name=<span class="xml-quote">"'GenderMap'"</span> id=<span class="xml-quote">"genders"</span>/></span> <span class="xml-tag"><ww:radio label=<span class="xml-quote">"'Gender'"</span> name=<span class="xml-quote">"'male'"</span> list=<span class="xml-quote">"#genders.genders"</span>/></span></pre>
|
||||
</div></div></p><b class="strong">属性</b>
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th> 名字 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> id </td><td> 否 </td><td> HTML的id属性 </td>
|
||||
</tr><tr>
|
||||
<td> name </td><td> <b class="strong">是</b> </td><td> HTML的name属性 </td>
|
||||
</tr><tr>
|
||||
<td> value </td><td> 否 </td><td> 字段值 </td>
|
||||
</tr><tr>
|
||||
<td> list </td><td> 否 </td><td> 列表使用的可迭代数据源 </td>
|
||||
</tr><tr>
|
||||
<td> listKey </td><td> 否 </td><td> 列表对象的键值属性 </td>
|
||||
</tr><tr>
|
||||
<td> listValue </td><td> 否 </td><td> 列表对象的内容属性 </td>
|
||||
</tr><tr>
|
||||
<td> disabled </td><td> 否 </td><td> HTML的disabled属性 </td>
|
||||
</tr><tr>
|
||||
<td> tabindex </td><td> 否 </td><td> HTML的tabindex属性</td>
|
||||
</tr><tr>
|
||||
<td> onchange </td><td> 否 </td><td> HTML的onchange属性 </td>
|
||||
</tr><tr>
|
||||
<td> onclick </td><td> 否 </td><td> HTML的onclick属性 </td>
|
||||
</tr><tr>
|
||||
<td> label </td><td> 否 </td><td> 用于模版中的标签文字 </td>
|
||||
</tr><tr>
|
||||
<td> labelposition </td><td> 否 </td><td> 标签的对齐方式 (left,right,center) </td>
|
||||
</tr><tr>
|
||||
<td> required </td><td> 否 </td><td> 在表单提交时是否是必需字段 </td>
|
||||
</tr><tr>
|
||||
<td> cssClass </td><td> 否 </td><td> HTML的class属性 </td>
|
||||
</tr><tr>
|
||||
<td> cssStyle </td><td> 否 </td><td> HTML的style属性 </td>
|
||||
</tr><tr>
|
||||
<td> theme </td><td> 否 </td><td> 使用的主题 </td>
|
||||
</tr><tr>
|
||||
<td> template </td><td> 否 </td><td> 使用的模版名 </td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,50 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Redirect Result</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Redirect Result
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 13, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h4 style="margin: 4px 0px 4px 0px;" class="heading4"><a name="RedirectResult-Redirect"> 重定向 </a></h4></p>通知浏览器重定向到另一个位置(将从客户端发出新的请求). 这意味着刚才执行的活动(活动实例, 活动错误, 字段错误等)将丢失不再可用. 这是因为活动基于单线程模式. 传递参数的唯一办法是使用session或使用OGNL表达式作为web参数(url?name=value). <br/>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th>参数 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> location </td><td> <b class="strong">是</b> </td><td> 执行后跳转的位置 </td>
|
||||
</tr><tr>
|
||||
<td> parse </td><td> 否 </td><td> 缺省为true. 如果设为false, location参数将不作为Ognl表达式进行解析 </td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"redirect"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"location"</span>></span>foo.jsp<span class="xml-tag"></param></span> <span class="xml-tag"><param name=<span class="xml-quote">"parse"</span>></span>false<span class="xml-tag"></param></span> <span class="xml-tag"></result></span></pre>
|
||||
</div></div>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,535 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Release Notes - 2.1.1</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Release Notes - 2.1.1
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="ReleaseNotes-2.1.1-WebWork2.1.1ReleaseNotes"> WebWork 2.1.1 Release Notes</a></h2></p><h3 class="heading3"><a name="ReleaseNotes-2.1.1-KeyChanges"> Key Changes</a></h3>
|
||||
<ul class="star">
|
||||
<li> Improved integration with Sitemesh<ul class="star">
|
||||
<li> WebWork taglibs can be used in Sitemesh decorators to access Action properties</li>
|
||||
</ul></li>
|
||||
<li> Validator short-circuiting to allow validation to stop on first invalid data</li>
|
||||
<li> Improved class hierarchy resource bundle searching</li>
|
||||
<li> File upload support has been rebuilt to allow for multiple files with the same HTTP parameter name. Besides "cos" and "pell" support, "jakarta" support has been added, utilizing the Commons-FileUpload library. Only "jakarta" supports multiple files with the same HTTP parameter name. In future versions "jakarta" may become the default upload library, replacing "pell".</li>
|
||||
</ul>
|
||||
<h3 class="heading3"><a name="ReleaseNotes-2.1.1-MigrationNotes"> Migration Notes</a></h3>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th> Version </th><th> Description </th><th> Old Code </th><th> New Code </th>
|
||||
</tr><tr>
|
||||
<td> 2.1 </td><td> There is a new validator DTD: xwork-validator-1.0.2.dtd. You aren't required to use this, but you will need to if you wish to use the new short-circuiting validation </td><td> N/A </td><td> N/A </td>
|
||||
</tr><tr>
|
||||
<td> 2.1 </td><td> File upload support has been rebuilt, although we don't see any compatibility problems with 2.1. However, many of the methods in MultiPartRequest have become deprecated in favor of new ones. Please switch to these as soon as possible. </td><td> N/A </td><td> N/A </td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3 class="heading3"><a name="ReleaseNotes-2.1.1-Changelog"> Changelog</a></h3>
|
||||
<h4 class="heading4"><a name="ReleaseNotes-2.1.1-WebWork2.1.1"> WebWork 2.1.1</a></h4>
|
||||
<p>
|
||||
<table width="100%" cellspacing="0" class="grid">
|
||||
<tr>
|
||||
<th colspan="3" style="text-align: left;">
|
||||
<a href="http://jira.opensymphony.com/secure/IssueNavigator.jspa?&pid=10030&fixfor=21320&sorter/field=issuekey&sorter/order=DESC&tempMax=25&reset=true&">OpenSymphony JIRA</a>
|
||||
<span class="smalltext">(25 issues)</span>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="text-align: left;">
|
||||
T </th>
|
||||
<th style="text-align: left;">
|
||||
Key </th>
|
||||
<th style="text-align: left;">
|
||||
Summary </th>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-648"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-648">WW-648</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-648">Client-side validation doesn't allow cancelling</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-647"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-647">WW-647</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-647">Client-side validation: show all validation errors</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-646"><img src="http://jira.opensymphony.com/images/icons/newfeature.gif" alt="New Feature" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-646">WW-646</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-646">HTML Editor Component</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-635"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-635">WW-635</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-635">Components and HttpSession persistence/distribution</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-598"><img src="http://jira.opensymphony.com/images/icons/newfeature.gif" alt="New Feature" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-598">WW-598</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-598">Add ability to map exceptions to pages (or actions)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-596"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-596">WW-596</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-596">IllegalArgumentException when setting an indexed property</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-591"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-591">WW-591</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-591">Wrong output when using nesting #bodytags (with a custom tag)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-589"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-589">WW-589</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-589">Printer-friendly of all documentatioon</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-588"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-588">WW-588</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-588">Unexpected behaviour of SessionMap.clear()</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-574"><img src="http://jira.opensymphony.com/images/icons/newfeature.gif" alt="New Feature" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-574">WW-574</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-574">ActionButton and ActionLink UI tags</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-570"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-570">WW-570</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-570">Table tag parameters and sorting</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-558"><img src="http://jira.opensymphony.com/images/icons/newfeature.gif" alt="New Feature" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-558">WW-558</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-558">Exception Handler Interceptor and Exception Action</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-557"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-557">WW-557</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-557">Generator Tag doesn't work properly</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-556"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-556">WW-556</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-556">Allow ComponentManager scopes to be independant</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-555"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-555">WW-555</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-555">Disable logging by default</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-540"><img src="http://jira.opensymphony.com/images/icons/newfeature.gif" alt="New Feature" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-540">WW-540</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-540">Add a ServletFilter to clean up the ActionContext, allowing Sitemesh decorators to use the ActionContext with the taglib</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-536"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-536">WW-536</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-536">Lost the session on OC4J 9.0.4 using WebWork2</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-533"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-533">WW-533</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-533">Add support for Velocity 1.4 - Changes WebWork directives</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-528"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-528">WW-528</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-528">Switch to using VelocityViewServlet from VelocityTools</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-527"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-527">WW-527</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-527">Multiple components with same <class> but different <enabler> throws exception</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-520"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-520">WW-520</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-520">Wrong &amp; management in XML based output (WML and XHTML)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-513"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-513">WW-513</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-513">IOC Application and Session scopes do not work in Tomcat 5</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-511"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-511">WW-511</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-511">Support a list of resource bundles on i18n tag</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-507"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-507">WW-507</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-507">"command" parameter isn't honored for command driven actions</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-506"><img src="http://jira.opensymphony.com/images/icons/newfeature.gif" alt="New Feature" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-506">WW-506</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-506">Param tag should try to get parameters from the original request as well</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
<p class="paragraph"><h4 class="heading4"><a name="ReleaseNotes-2.1.1-Xwork1.0.2"> Xwork 1.0.2</a></h4>
|
||||
<p>
|
||||
<table width="100%" cellspacing="0" class="grid">
|
||||
<tr>
|
||||
<th colspan="3" style="text-align: left;">
|
||||
<a href="http://jira.opensymphony.com/secure/IssueNavigator.jspa?&pid=10050&fixfor=21372&sorter/field=issuekey&sorter/order=DESC&tempMax=25&reset=true&">OpenSymphony JIRA</a>
|
||||
<span class="smalltext">(15 issues)</span>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="text-align: left;">
|
||||
T </th>
|
||||
<th style="text-align: left;">
|
||||
Key </th>
|
||||
<th style="text-align: left;">
|
||||
Summary </th>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-210"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-210">XW-210</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/XW-210">Make default type conversion message a localized text that can be overidden</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-205"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-205">XW-205</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/XW-205">missing xwork 1.0.2 dtd in jar and website and typo in ValidationInterceptor</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-204"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-204">XW-204</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/XW-204">TextProvider.getText() should look in child property files</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-203"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-203">XW-203</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/XW-203">Add "trim" parameter to string validators</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-202"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-202">XW-202</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/XW-202">Integer and Float conversion dont work in CVS HEAD</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-200"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-200">XW-200</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/XW-200">i18n broken when the name of the text to find starts with a property exposed by the action</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-195"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-195">XW-195</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/XW-195">Add interface XWorkStatics which contains XWork-related constants from WebWorkStatics</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-194"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-194">XW-194</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/XW-194">Patch to help LocalizedTextUtil deal with messages for indexed fields (collections)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-193"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-193">XW-193</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/XW-193">InstantiatingNullHandler and Typeconversion fails</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-192"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-192">XW-192</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/XW-192">Create a version 1.0.2 of the XWork validation DTD with short circuit</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-191"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-191">XW-191</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/XW-191">Type conversion improvement.</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-190"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-190">XW-190</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/XW-190">Provide a xwork-default.xml.</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-189"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-189">XW-189</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/XW-189">Improve ActionValidationManager's short circuit behaviour</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-179"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-179">XW-179</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/XW-179">Optimise OgnlUtil.copy method</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-172"><img src="http://jira.opensymphony.com/images/icons/newfeature.gif" alt="New Feature" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/XW-172">XW-172</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/XW-172">XWorkBasicConverter doesn't care about the current locale</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,215 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Release Notes - 2.1.2</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Release Notes - 2.1.2
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="ReleaseNotes-2.1.2-WebWork2.1.2ReleaseNotes"> WebWork 2.1.2 Release Notes</a></h2></p><h3 class="heading3"><a name="ReleaseNotes-2.1.2-KeyChanges"> Key Changes</a></h3>
|
||||
<ul class="star">
|
||||
<li> This version ships with XWork 1.0.3 – we recommend you make sure you are running this version (or later) of XWork.</li>
|
||||
<li> Minor bug fixes for file upload support with Jakarta</li>
|
||||
<li> New StreamResult type which allows you to stream content directly back from an action</li>
|
||||
<li> UI tags may now be written in languages other than Velocity. JSP is supported, though you currently must write your own templates similar to the Velocity templates. Future versions of WebWork will include more languages supported as well as templates shippped out of the box.</li>
|
||||
</ul>
|
||||
<h3 class="heading3"><a name="ReleaseNotes-2.1.2-MigrationNotes"> Migration Notes</a></h3><p class="paragraph">Migration should require nothing more than copying over the new libs. Specifically note that XWork 1.0.3 and WebWork 2.1.2 should be copied over.</p><h3 class="heading3"><a name="ReleaseNotes-2.1.2-Changelog"> Changelog</a></h3><p class="paragraph"><p>
|
||||
<table width="100%" cellspacing="0" class="grid">
|
||||
<tr>
|
||||
<th colspan="3" style="text-align: left;">
|
||||
<a href="http://jira.opensymphony.com/secure/IssueNavigator.jspa?&pid=10030&fixfor=21391&sorter/field=issuekey&sorter/order=DESC&tempMax=25&reset=true&">OpenSymphony JIRA</a>
|
||||
<span class="smalltext">(14 issues)</span>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="text-align: left;">
|
||||
T </th>
|
||||
<th style="text-align: left;">
|
||||
Key </th>
|
||||
<th style="text-align: left;">
|
||||
Summary </th>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-642"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-642">WW-642</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-642">Allow the 'name' attribute of the TextTag to be evaluated at runtime</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-639"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-639">WW-639</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-639">"Could not open template ", possible a bug</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-634"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-634">WW-634</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-634">File Upload Interceptor stack</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-633"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-633">WW-633</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-633">Jakarta File Upload fails with mixed content (normal and file)</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-630"><img src="http://jira.opensymphony.com/images/icons/newfeature.gif" alt="New Feature" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-630">WW-630</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-630">upload newest webwork files to ibiblio</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-629"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-629">WW-629</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-629">checkboxlist doesn't have a disabled attribute tag</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-628"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-628">WW-628</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-628">Bug with request parameter handling with WebLogic 8.1sp3</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-624"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-624">WW-624</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-624">If/Else tag do not render body</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-622"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-622">WW-622</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-622">The changelog for WW2.1.1 shows open issues not the closed ones!</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-616"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-616">WW-616</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-616">ww:label and ww:textarea problem with null values</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-612"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-612">WW-612</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-612">WebworkStatistics.SERVLET_DISPATCHER is spelled incorrectly</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-611"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-611">WW-611</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-611">Error in Freemarker docs</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-602"><img src="http://jira.opensymphony.com/images/icons/newfeature.gif" alt="New Feature" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-602">WW-602</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-602">Stream Result Type</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-485"><img src="http://jira.opensymphony.com/images/icons/task.gif" alt="Task" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-485">WW-485</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-485">Add docs for WebWork2 tags</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,67 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Release Notes - 2.1.3</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Release Notes - 2.1.3
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="ReleaseNotes-2.1.3-WebWork2.1.3ReleaseNotes"> WebWork 2.1.3 Release Notes</a></h2></p><h3 class="heading3"><a name="ReleaseNotes-2.1.3-KeyChanges"> Key Changes</a></h3>
|
||||
WebWork version 2.1.3 resolves a critical problem preventing UI tags from working under certain circumstances. It is recommended that all users use 2.1.3 in place of 2.1.1 or 2.1.2<p class="paragraph"><h3 class="heading3"><a name="ReleaseNotes-2.1.3-Changelog"> Changelog</a></h3></p><p>
|
||||
<table width="100%" cellspacing="0" class="grid">
|
||||
<tr>
|
||||
<th colspan="3" style="text-align: left;">
|
||||
<a href="http://jira.opensymphony.com/secure/IssueNavigator.jspa?&pid=10030&fixfor=21392&sorter/field=issuekey&sorter/order=DESC&tempMax=25&reset=true&">OpenSymphony JIRA</a>
|
||||
<span class="smalltext">(1 issues)</span>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="text-align: left;">
|
||||
T </th>
|
||||
<th style="text-align: left;">
|
||||
Key </th>
|
||||
<th style="text-align: left;">
|
||||
Summary </th>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-659"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-659">WW-659</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-659">VelocityTemplateEngine broken</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,66 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Release Notes - 2.1.4</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Release Notes - 2.1.4
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="ReleaseNotes-2.1.4-WebWork2.1.4ReleaseNotes"> WebWork 2.1.4 Release Notes</a></h2></p><h3 class="heading3"><a name="ReleaseNotes-2.1.4-KeyChanges"> Key Changes</a></h3>
|
||||
This release is the first release to include the re-vamped JSP tag support. Specifically, there is an option (off by default) that now lets you use an alternative syntax for JSP tags.<p class="paragraph">When <b class="strong">webwork.tag.altSyntax</b> is set to true in webwork.properties, all attributes in the JSP tags (both UI and non-UI) that evaluate to a String (as opposed to a Boolean, Integer, Collection, or anything else) shall not be evaluated like it normally is.</p>Rather, the string will be parsed for the pattern "%{...}" and only the text between those braces shall be evaluated. This should make using all the tags, but especially the UI tags, much easier. <p class="paragraph">The only exception to this rule of parsing String attributes is for the <ww:property/> tag. That is because the usage for <ww:property/> is so commonly used for pulling values from the stack, enforcing the "%{..}" syntax on it would be overly tedious.</p><h3 class="heading3"><a name="ReleaseNotes-2.1.4-MigrationNotes"> Migration Notes</a></h3><p class="paragraph">There is nothing to migrate for now. Because this new syntax is optional and turned off by default, you don't need to do anything to migrate as long as you don't plan to use this new syntax. If you DO plan to use this new syntax, you must modify all your tag attributes that previously had the pattern of "'...'" to just be "...". Basically, you must remove single quotes where they once were.</p>Also, any place where an attribute did not have single quotes, you must check to see if the attribute is expected to be a String attribute. If so, you should replace the pattern of "..." with "%{...}" so that the expression is still being evaluated.<p class="paragraph">Note that attributes such as disabled, maxlength, etc do not need the new syntax. <b class="strong">That is becaus the syntax is only applied to attributes that are expected to be strings</b>. This is very important to remember!</p><b class="strong">Finally, please note that this release is a preview release for the new syntax. The new syntax will not be finalized and turned on by default until 2.2.0. You are free to use it, but it is not guaranteed to be stable and may change in the coming releases</b>.<p class="paragraph"><h3 class="heading3"><a name="ReleaseNotes-2.1.4-Changelog"> Changelog</a></h3></p><p>
|
||||
<table width="100%" cellspacing="0" class="grid">
|
||||
<tr>
|
||||
<th colspan="3" style="text-align: left;">
|
||||
<a href="http://jira.opensymphony.com/secure/IssueNavigator.jspa?&pid=10030&fixfor=21393&sorter/field=issuekey&sorter/order=DESC&tempMax=25&reset=true&">OpenSymphony JIRA</a>
|
||||
<span class="smalltext">(1 issues)</span>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="text-align: left;">
|
||||
T </th>
|
||||
<th style="text-align: left;">
|
||||
Key </th>
|
||||
<th style="text-align: left;">
|
||||
Summary </th>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-581"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-581">WW-581</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-581">JSP Tags should support better syntax</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,264 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Release Notes - 2.1.5</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Release Notes - 2.1.5
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="ReleaseNotes-2.1.5-WebWork2.1.5ReleaseNotes"> WebWork 2.1.5 Release Notes</a></h2></p><h3 class="heading3"><a name="ReleaseNotes-2.1.5-KeyChanges"> Key Changes</a></h3>
|
||||
<ul class="star">
|
||||
<li> All UI tags now support the complete set of JavaScript event listeners now, such as onChange, onBlur, etc.</li>
|
||||
<li> ExecuteAndWaitInterceptor is easier to use</li>
|
||||
<li> Several important bug fixes for Velocity integration</li>
|
||||
</ul> <p class="paragraph"><h3 class="heading3"><a name="ReleaseNotes-2.1.5-MigrationNotes"> Migration Notes</a></h3></p><table class="wikitable">
|
||||
<tr>
|
||||
<th> Version </th><th> Description </th><th> Old Code </th><th> New Code </th>
|
||||
</tr><tr>
|
||||
<td> 2.1.4 and below </td><td> TLD updated – be sure you are using the latest webwork.tld file </td><td> N/A </td><td> N/A </td>
|
||||
</tr>
|
||||
</table><p class="paragraph"><h3 class="heading3"><a name="ReleaseNotes-2.1.5-Changelog"> Changelog</a></h3></p><p>
|
||||
<table width="100%" cellspacing="0" class="grid">
|
||||
<tr>
|
||||
<th colspan="3" style="text-align: left;">
|
||||
<a href="http://jira.opensymphony.com/secure/IssueNavigator.jspa?&pid=10030&fixfor=21411&sorter/field=issuekey&sorter/order=DESC&tempMax=25&reset=true&">OpenSymphony JIRA</a>
|
||||
<span class="smalltext">(18 issues)</span>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="text-align: left;">
|
||||
T </th>
|
||||
<th style="text-align: left;">
|
||||
Key </th>
|
||||
<th style="text-align: left;">
|
||||
Summary </th>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-666"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-666">WW-666</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-666">ExecAndWaitInterceptor should put executing action on the stack</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-663"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-663">WW-663</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-663">VelocityResult doesn't initialize VelocityManager</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-660"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-660">WW-660</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-660">xhtml's checkbox.vm vertical alignment</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-658"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-658">WW-658</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-658">JSP Tags do not support onFocus, onBlur js handlers</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-653"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-653">WW-653</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-653">url taglib does not support 'page' attribute but the webwork-example.war uses it all over the place.</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-651"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-651">WW-651</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-651">IfTag does not convert to Boolean</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-644"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-644">WW-644</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-644">Xhtml generated by the ui tags is (still) invalid</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-632"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-632">WW-632</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-632">Onclick for radiotag</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-627"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-627">WW-627</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-627">select.vm requires htmlEncode for name parameter</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-626"><img src="http://jira.opensymphony.com/images/icons/newfeature.gif" alt="New Feature" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-626">WW-626</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-626">Principal Interceptor</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-614"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-614">WW-614</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-614">Cannot set velocity macro autoreloading</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-554"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-554">WW-554</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-554">Bad value for IMAGES_URI in JasperReportsResult.java</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-526"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-526">WW-526</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-526">Velocity using include ignores character encoding</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-479"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-479">WW-479</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-479">getValueClassType() in ComboboxTag returns Boolean.class</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-425"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-425">WW-425</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-425">Refactoring to decouple the UI Tag dependency on velocity</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-392"><img src="http://jira.opensymphony.com/images/icons/task.gif" alt="Task" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-392">WW-392</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-392">Update doubleselect tag</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-223"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-223">WW-223</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-223">Multipart & SaveDir</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-161"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-161">WW-161</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-161">ServletDispatcher could be a lot simpler to extend</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,111 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Release Notes - 2.1.6</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Release Notes - 2.1.6
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="ReleaseNotes-2.1.6-WebWork2.1.6ReleaseNotes"> WebWork 2.1.6 Release Notes</a></h2></p><h3 class="heading3"><a name="ReleaseNotes-2.1.6-KeyChanges"> Key Changes</a></h3>
|
||||
This release includes a few bug fixes for the URL tag, a new base class to make type conversion easier, and better documentation. It also includes the latest XWork release: version 1.0.4<p class="paragraph"><h3 class="heading3"><a name="ReleaseNotes-2.1.6-Changelog"> Changelog</a></h3></p><p>
|
||||
<table width="100%" cellspacing="0" class="grid">
|
||||
<tr>
|
||||
<th colspan="3" style="text-align: left;">
|
||||
<a href="http://jira.opensymphony.com/secure/IssueNavigator.jspa?&pid=10030&fixfor=21412&sorter/field=issuekey&sorter/order=DESC&tempMax=25&reset=true&">OpenSymphony JIRA</a>
|
||||
<span class="smalltext">(5 issues)</span>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="text-align: left;">
|
||||
T </th>
|
||||
<th style="text-align: left;">
|
||||
Key </th>
|
||||
<th style="text-align: left;">
|
||||
Summary </th>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-673"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-673">WW-673</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-673">Create a WebWorkTypeConverter for extension</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-672"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-672">WW-672</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-672">URLTag does not reset between invocations</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-671"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-671">WW-671</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-671">URLTag does not include parameters when value is specified</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-664"><img src="http://jira.opensymphony.com/images/icons/newfeature.gif" alt="New Feature" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-664">WW-664</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-664">Document WebFlow</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-585"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-585">WW-585</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-585">ComboBoxTag should sublass TextFieldTag</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,360 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Release Notes - 2.1</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Release Notes - 2.1
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">plightbo</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="ReleaseNotes-2.1-KeyChanges"> Key Changes</a></h3></p><ul class="star">
|
||||
<li> JavaScript client validation support - not totally complete, but basic validators work well. Look at the validators.xml file include in src/example to see how you can configure your validators to do client side validation on top of their normal duties</li>
|
||||
<li> The label attribute in UI tags are no longer required</li>
|
||||
<li> The themes and templates in UI tags behave like they did in 1.x</li>
|
||||
<li> A new theme, in addition to the existing "xhtml" one, called "simple" is included that doesn't have any of the labels, error reporting, or table rows that the "xhtml" template has. This is more in line with the tags included with Struts.</li>
|
||||
<li> New UI tags for CSS styles and classes added: cssStyle and cssClass</li>
|
||||
<li> Old action!command URL support works again. This means you can invoke a doCommand() method like in 1.x</li>
|
||||
<li> ww:param tag no longer requires the name attribute (for ordered params, like with ww:text). It also evaluates the the body as the value if no value is given.</li>
|
||||
<li> UI tags now have access to the FormTag parameter map using the "form" key. This means $parameters.form.name would return the form name, for example. The result is that complex JavaScript-based components can be built.</li>
|
||||
</ul>
|
||||
<h3 class="heading3"><a name="ReleaseNotes-2.1-MigrationNotes"> Migration Notes</a></h3>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th> Version </th><th> Description </th><th> Old Code </th><th> New Code </th>
|
||||
</tr><tr>
|
||||
<td> 2.0 </td><td> WebWorkUtil has been refactored into a number of classes, and the constructor has changed. If you were using it for Velocity support before, look at VelocityWebWorkUtil now </td><td> </td><td> </td>
|
||||
</tr><tr>
|
||||
<td> 2.0 </td><td> The <em class="emphasis">webwork.ui.templateDir</em> configuration property has been broken into <em class="emphasis">webwork.ui.templateDir</em> and <em class="emphasis">webwork.ui.theme</em> </td><td> <div class="code"><div class="codeContent">
|
||||
<pre>webwork.ui.templateDir= /webwork/mytheme</pre>
|
||||
</div></div> </td><td> <div class="code"><div class="codeContent">
|
||||
<pre>webwork.ui.templateDir = /webwork webwork.ui.theme = mytheme</pre>
|
||||
</div></div> </td>
|
||||
</tr><tr>
|
||||
<td> 2.0 </td><td> "namespace" attribute of the ww:action tag is now evaluated; those upgrading from 2.0 will need to place single quotes around the attribute value</td><td> <ww:action namespace="/foo" .../> </td><td> <ww:action namespace="'/foo'" .../> </td>
|
||||
</tr><tr>
|
||||
<td> 2.0, but not 1.x </td><td> theme and template attributes in UI tags have changed are now evaluated; those upgrading from 2.0 will need to place single quotes around the attribute value</td><td> <ww:xxxx theme="/template/foo" template="bar.vm"/> </td><td> <ww:xxxx theme="'foo'" template="'bar.vm'"/> </td>
|
||||
</tr><tr>
|
||||
<td> 1.x, 2.0 </td><td> label UI tag evaluates the value attribute now instead of the name attribute </td><td> <ww:label name="'Foo'"/> </td><td> <ww:label value="'Foo'"/> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<h3 class="heading3"><a name="ReleaseNotes-2.1-Changelog%3Caname%3D%22ReleaseNotes2.1Changelog%22%3E%3C%2Fa%3E"> Changelog <a name="ReleaseNotes-2.1-Changelog"></a></a></h3><p class="paragraph"><p>
|
||||
<table width="100%" cellspacing="0" class="grid">
|
||||
<tr>
|
||||
<th colspan="3" style="text-align: left;">
|
||||
<a href="http://jira.opensymphony.com/secure/IssueNavigator.jspa?&pid=10030&fixfor=21215&sorter/field=issuekey&sorter/order=DESC&tempMax=25&reset=true&">OpenSymphony JIRA</a>
|
||||
<span class="smalltext">(25 issues)</span>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="text-align: left;">
|
||||
T </th>
|
||||
<th style="text-align: left;">
|
||||
Key </th>
|
||||
<th style="text-align: left;">
|
||||
Summary </th>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-592"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-592">WW-592</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-592">Upgrade commons-logging</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-560"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-560">WW-560</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-560">SessionMap holds on to requests when it doens't need to</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-546"><img src="http://jira.opensymphony.com/images/icons/newfeature.gif" alt="New Feature" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-546">WW-546</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-546">Make the config-browser show validators applied via the XML validation files</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-544"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-544">WW-544</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-544">Velocity result hardcodes contenttype and encoding</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-541"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-541">WW-541</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-541">Webpage link for download</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-537"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-537">WW-537</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-537">Velocity tag outputs to the response, not the velocity writer</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-530"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-530">WW-530</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-530">Config Browser doesn't work after lates ActionConfig refactoring</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-519"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-519">WW-519</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-519">ActionTag should evaluate namespace attribute</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-518"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-518">WW-518</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-518">Label attribute shouldn't be required</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-517"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-517">WW-517</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-517">Themes and templates should behave like 1.x</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-516"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-516">WW-516</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-516">Simple theme that has no tables and xhtml extends from</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-515"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-515">WW-515</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-515">Class attribute is illegal</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-514"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-514">WW-514</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-514">Form tag double evaluates name attribute</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-503"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-503">WW-503</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-503">Fix tag libraries</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-502"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-502">WW-502</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-502">foo!default.action should work</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-501"><img src="http://jira.opensymphony.com/images/icons/newfeature.gif" alt="New Feature" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-501">WW-501</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-501">JavaSript-based client side validation</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-500"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-500">WW-500</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-500">ww:param tag fixes</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-499"><img src="http://jira.opensymphony.com/images/icons/newfeature.gif" alt="New Feature" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-499">WW-499</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-499">UI tags should have access to form</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-488"><img src="http://jira.opensymphony.com/images/icons/task.gif" alt="Task" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-488">WW-488</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-488">Check QuickStart Guide to make sure it works</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-487"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-487">WW-487</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-487">WebWorkConversionErrorInterceptorTest in wrong branch</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-484"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-484">WW-484</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-484">label tag problems</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-478"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-478">WW-478</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-478">URLTag tld entry does not correspond with actual property</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-476"><img src="http://jira.opensymphony.com/images/icons/improvement.gif" alt="Improvement" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-476">WW-476</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-476">WebWork needs a simple changelog for each release</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowAlternate">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-475"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-475">WW-475</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-475">Multipart encoding still not fixed</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowNormal">
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-474"><img src="http://jira.opensymphony.com/images/icons/bug.gif" alt="Bug" border="0" /></a>
|
||||
</td>
|
||||
<td nowrap="true">
|
||||
<a href="http://jira.opensymphony.com/browse/WW-474">WW-474</a>
|
||||
</td>
|
||||
<td >
|
||||
<a href="http://jira.opensymphony.com/browse/WW-474">Ability to dynamically create array of Objects from a given request</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,38 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 重加载配置文件</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 重加载配置文件
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on May 14, 2004 by <font color="#0050B2">mgreer</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph">Webwork允许动态重新加载xml配置文件(例如, 重新加载actions.xml).</p>这允许你在开发期间重新配置活动映射. 这可能会带来一些性能损失, 因此不推荐在产品模式下使用.<p class="paragraph">为了激活该特性, 需要在webwork.properties中加入:</p><div class="code"><div class="codeContent">
|
||||
<pre>webwork.configuration.xml.reload=<span class="java-keyword">true</span></pre>
|
||||
</div></div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,97 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Resources Available to Velocity Views</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Resources Available to Velocity Views
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 10, 2004 by <font color="#0050B2">sutter2k</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="ResourcesAvailabletoVelocityViews-Summary"> Summary</a></h3>
|
||||
Here's the quick summary of the references available to Velocity templates that are kicked-off from WebWork:</p><ul class="star">
|
||||
<li> $actionInstanceVariable</li>
|
||||
<li> $req - the current HttpServletRequest</li>
|
||||
<li> $res - the current HttpServletResponse</li>
|
||||
<li> $stack - the current OgnlValueStack</li>
|
||||
<li> $ognl - an OgnlTool</li>
|
||||
<li> $webwork - an instance of WebWorkUtil</li>
|
||||
<li> $action - the current WebWork action</li>
|
||||
<li> $taglib (or something like that) - access to the JSP tag library via Velocity macros (!!)</li>
|
||||
</ul>
|
||||
<h3 class="heading3"><a name="ResourcesAvailabletoVelocityViews-Detail"> Detail</a></h3>
|
||||
<br clear="all" />
|
||||
<b class="strong">$actionInstanceVariable</b><br/>
|
||||
Each of your action class instance variables (for which you've written a getter method) are available in your Velocity template as $actionInstanceVariableName.<p class="paragraph">In other words, if you have an instance variable in your Action class:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="java-keyword">public</span> class ProcessEditTableRowAction <span class="java-keyword">extends</span> ActionSupport { <span class="java-keyword">private</span> <span class="java-object">String</span> fooString;</pre>
|
||||
</div></div></p>And you have a getter method for that string (in that same ActionClass):<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="java-keyword">public</span> <span class="java-object">String</span> getFooString() { <span class="java-keyword">return</span> fooString; }</pre>
|
||||
</div></div><p class="paragraph">Then in your Velocity template you can retrieve the value of that String by simply refering to:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>$fooString</pre>
|
||||
</div></div></p>Note: For the most part you don't have to worry about lettercase. If your Velocity reference is $fooString (note the lowercase "f" in foo) and your getter method is called getFooString (note uppercase "F" in foo) then WebWork does the "right thing" and uses getFooString() to retrieve the value of $fooString.<p class="paragraph">But things can get weird is some circumstances. <em class="emphasis">TODO:</em> At least I think they can get weird. At one point, I remember having a problem with the lettercase of Velocity variable names and the corresponding getter methods that was being used to lookup the value. But I can't remember exactly how the problem manifested so can't provide an example. Need to do that.</p><em class="emphasis">TODO:</em> I'm curious what takes care of translating the $variableName references to method calls on the Action object's getters. Where does that happen?<p class="paragraph"><br clear="all" />
|
||||
<b class="strong">$req</b><br/>
|
||||
The current HttpServletRequest created and managed by your Servlet environment (Tomcat, Resin, etc.).</p><br clear="all" />
|
||||
<b class="strong">$res</b><br/>
|
||||
The current HttpServletResponse created and managed by your Servlet environment (Tomcat, Resin, etc.). <p class="paragraph"><br clear="all" />
|
||||
<b class="strong">$stack</b><br/>
|
||||
The OGNL value stack. (<a href="http://www.opensymphony.com/xwork/api/com/opensymphony/xwork/util/OgnlValueStack.html" title="Visit page outside Confluence">API Docs</a>)</p><em class="emphasis">TODO:</em> Talk about what's actually <b class="strong">on</b> the stack. Doesn't do a whole lot of good to know it's there without knowing what's on it.<p class="paragraph"><br clear="all" />
|
||||
<b class="strong">$ognl</b><br/>
|
||||
A reference to an OGNL tool. (<a href="http://www.opensymphony.com/webwork/api/com/opensymphony/webwork/views/jsp/ui/OgnlTool.html" title="Visit page outside Confluence">API Docs</a>)<br/>
|
||||
(<a href="http://wiki.opensymphony.com/display/XW/Ognl" title="Visit page outside Confluence">See OGNL Basics</a>)</p>At the time of this writing, there are no docs for that object, so if you really want to know how it works, be a <a href="http://en.wikipedia.org/wiki/Jedi" title="Visit page outside Confluence">Jedi</a> and "use the source". (The CVS repository is browsable here: <a href="https://webwork.dev.java.net/source/browse/webwork/src/java" title="Visit page outside Confluence">https://webwork.dev.java.net/source/browse/webwork/src/java</a>)<p class="paragraph"><br clear="all" />
|
||||
<em class="emphasis">Tip:</em><br/>
|
||||
Jason/Patrick note that one nifty thing you can do with this tool is to call static class methods. That's rather handy since Velocity doesn't offer access to class variables or methods, but only to instantiate objects that have been placed in the Velocity Context. So you can't normally do things like Math.random().</p>To call a class method, from within Velocity template, using the OGNL tool, you do this:<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>$ognl.findValue(<span class="java-quote">"@com.acme.FooClass@FOO"</span>)</pre>
|
||||
</div></div><p class="paragraph"><em class="emphasis">TODO:</em> the original email detailing the above example used $value to refer to the OGNL tool, not $ognl. But the source indicates it's "$ognl" that's shared with the context. Which is right?</p><br clear="all" />
|
||||
<b class="strong">$webwork</b><br/>
|
||||
A reference to the VelocityWebWorkUtil class. (<a href="http://www.opensymphony.com/webwork/api/com/opensymphony/webwork/util/WebWorkUtil.html" title="Visit page outside Confluence">API Docs</a>)<p class="paragraph">At the time of this writing, the API docs for this object are effectively blank, so if you really want to know how it works, be a <a href="http://en.wikipedia.org/wiki/Jedi" title="Visit page outside Confluence">Jedi</a> and "use the source". (The CVS repository is browsable here: <a href="https://webwork.dev.java.net/source/browse/webwork/src/java" title="Visit page outside Confluence">https://webwork.dev.java.net/source/browse/webwork/src/java</a>)</p><br clear="all" />
|
||||
<em class="emphasis">Tip:</em><br/>
|
||||
Mathew notes that the VelocityWebWorkUtil class can instantiate other objects for you. This, too, is very handy since Velocity is normally constrained to only the objects that have been explicitely shared with it's context (and not something you have control over when using Velocity templates kicked off by WebWork).<p class="paragraph">To instantiate an object from a Velocity page (that's been kicked off by WebWork, of course) do this:</p><div class="code"><div class="codeContent">
|
||||
<pre>#set($object = $webwork.bean(<span class="java-quote">"com.foo.ClassName"</span>))</pre>
|
||||
</div></div><p class="paragraph">This technique can be particularly handy for grabbing a reference to one of the <a href="http://jakarta.apache.org/velocity/tools/" title="Visit page outside Confluence">VelocityTools</a> objects. (The VelocityTools are not included with WebWork, you'll need to go grab the lib and put it in your classpath if you want to use $webwork.bean() to grab references to the tool objects.)</p>(Note: If you're rumaging through the source, the source-code for the $webwork.bean() method above is really in VelocityWebWorkUtil's parent class WebWorkUtil.)<p class="paragraph"><br clear="all" />
|
||||
<b class="strong">$action</b><br/>
|
||||
A reference to the action context that called this template. <em class="emphasis">TODO:</em> Not really sure what's in there or what it's good for. Should probably note that.</p><br clear="all" />
|
||||
<b class="strong">#tag</b> and <b class="strong">#bodytag</b>#<p class="paragraph">Provides a way of using a JSP taglib from velocity.<br/>
|
||||
Many, but not all taglibs can be used.</p>ex:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>#tag( Text <span class="java-quote">"name='title.edit'"</span> )</pre>
|
||||
</div></div><br/>
|
||||
provides a way to uses the <ww:text name="title.edit" /> tag from velocity.<p class="paragraph">Note the <ww:text /> is probably not that useful from velocity since
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre>$action.getText('title.edit')</pre>
|
||||
</div></div> would perform the same thing.</p>see <a href="UI tags.html#UITags-WW%2FUI%2BTags" title="WW/UI+Tags on UI Tags">UI tags#WW/UI+Tags</a> for more information about webworks tags. Many provide equivalent velocity examples. Usage with other tags could be infered based on examples given. <br/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,81 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 结果类型</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 结果类型
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 13, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="ResultTypes-Overview"> 综述</a></h2></p><b class="strong">结果类型</b>是一些类, 用于决定活动值执行完毕并返回一个结果后应该执行那些动作. 开发者可以根据应用会环境的需要自由的创建自己的结果类型. 在WebWork 2中, 例如, Servlet和Velocity结果类型已经编写完成用来处理视图绘制.<p class="paragraph"><ins class="inserted">注意:</ins> 所有WebWork附带的结果类型都实现了<tt class="monospaced">com.opensymphony.xwork.Result</tt>接口, 它描述了所有活动执行结果的通用接口, 不管是显示Web页面, 生成电子邮件, 发送JMS消息, 等等.</p>结果类型定义了类并将它映射为到一个名字以便在活动结果配置中引用. 它为这些类提供了简写的名值对.
|
||||
<div class="code"><div class="codeHeader"><b>webwork-default.xml的片断</b></div><div class="codeContent">
|
||||
<pre>... <span class="xml-tag"><result-types></span> <span class="xml-tag"><result-type name=<span class="xml-quote">"dispatcher"</span> class=<span class="xml-quote">"com.opensymphony.webwork.dispatcher.ServletDispatcherResult"</span> default=<span class="xml-quote">"true"</span>/></span> <span class="xml-tag"><result-type name=<span class="xml-quote">"redirect"</span> class=<span class="xml-quote">"com.opensymphony.webwork.dispatcher.ServletRedirectResult"</span>/></span> <span class="xml-tag"><result-type name=<span class="xml-quote">"velocity"</span> class=<span class="xml-quote">"com.opensymphony.webwork.dispatcher.VelocityResult"</span>/></span> <span class="xml-tag"><result-type name=<span class="xml-quote">"chain"</span> class=<span class="xml-quote">"com.opensymphony.xwork.ActionChainResult"</span>/></span> <span class="xml-tag"><result-type name=<span class="xml-quote">"xslt"</span> class=<span class="xml-quote">"com.opensymphony.webwork.views.xslt.XSLTResult"</span>/></span> <span class="xml-tag"><result-type name=<span class="xml-quote">"jasper"</span> class=<span class="xml-quote">"com.opensymphony.webwork.views.jasperreports.JasperReportsResult"</span>/></span> <span class="xml-tag"><result-type name=<span class="xml-quote">"freemarker"</span> class=<span class="xml-quote">"com.opensymphony.webwork.views.freemarker.FreemarkerResult"</span>/></span> <span class="xml-tag"><result-type name=<span class="xml-quote">"httpheader"</span> class=<span class="xml-quote">"com.opensymphony.webwork.dispatcher.HttpHeaderResult"</span>/></span> <span class="xml-tag"><result-type name=<span class="xml-quote">"stream"</span> class=<span class="xml-quote">"com.opensymphony.webwork.dispatcher.StreamResult"</span>/></span> <span class="xml-tag"></result-types></span> ...</pre>
|
||||
</div></div><br/>
|
||||
|
||||
<div class="code"><div class="codeHeader"><b>xwork.xml的片断</b></div><div class="codeContent">
|
||||
<pre><span class="xml-tag"><include file=<span class="xml-quote">"webwork-default.xml"</span>/></span> <span class="xml-tag"><package name=<span class="xml-quote">"myPackage"</span> extends=<span class="xml-quote">"default"</span>></span> <span class="xml-tag"><action name=<span class="xml-quote">"bar"</span> class=<span class="xml-quote">"myPackage.barAction"</span>></span> <span class="xml-tag"><span class="xml-comment"><!-- default result type is <span class="xml-quote">"dispatcher"</span> --></span></span> <span class="xml-tag"><span class="xml-comment"><!-- default result name is <span class="xml-quote">"success"</span> --></span></span> <span class="xml-tag"><result></span>foo.jsp<span class="xml-tag"></result></span> <span class="xml-tag"><result name=<span class="xml-quote">"error"</span>></span>error.jsp<span class="xml-tag"></result></span> <span class="xml-tag"></result></span> <span class="xml-tag"></action></span> <span class="xml-tag"></package></span></pre>
|
||||
</div></div><p class="paragraph"><h2 class="heading2"><a name="ResultTypes-ResultTypes"> Result Types</a></h2></p>Webwork提供了<tt class="monospaced">com.opensymphony.xwork.Result</tt>接口的几个实现使得基于Web的应用容易与活动相结合. 这些结果类型包括:<br/>
|
||||
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th> Result Type </th><th> name </th><th> class </th>
|
||||
</tr><tr>
|
||||
<td> <a href="Dispatcher Result.html" title="Dispatcher Result">Dispatcher Result</a> </td><td> dispatcher </td><td> com.opensymphony.webwork.dispatcher.ServletDispatcherResult </td>
|
||||
</tr><tr>
|
||||
<td> <a href="Redirect Result.html" title="Redirect Result">Redirect Result</a> </td><td> redirect </td><td> com.opensymphony.webwork.dispatcher.ServletRedirectResult </td>
|
||||
</tr><tr>
|
||||
<td> <a href="Action Chaining Result.html" title="Action Chaining Result">Action Chaining Result</a> </td><td> chain </td><td> com.opensymphony.xwork.ActionChainResult </td>
|
||||
</tr><tr>
|
||||
<td> <a href="Velocity Result.html" title="Velocity Result">Velocity Result</a> </td><td> velocity </td><td> com.opensymphony.webwork.dispatcher.VelocityResult </td>
|
||||
</tr><tr>
|
||||
<td> <a href="FreeMarker Result.html" title="FreeMarker Result">FreeMarker Result</a> </td><td> freemarker </td><td> com.opensymphony.webwork.views.freemarker.FreemarkerResult </td>
|
||||
</tr><tr>
|
||||
<td> <a href="JasperReports Result.html" title="JasperReports Result">JasperReports Result</a> </td><td> jasper </td><td> com.opensymphony.webwork.views.jasperreports.JasperReportsResult </td>
|
||||
</tr><tr>
|
||||
<td> <a href="XSL Result.html" title="XSL Result">XSL Result</a> </td><td> xslt </td><td> com.opensymphony.webwork.views.xslt.XSLTResult </td>
|
||||
</tr><tr>
|
||||
<td> <a href="HttpHeader Result.html" title="HttpHeader Result">HttpHeader Result</a> </td><td> header </td><td> com.opensymphony.webwork.dispatcher.HttpHeaderResult </td>
|
||||
</tr><tr>
|
||||
<td> <a href="Stream Result.html" title="Stream Result">Stream Result</a> </td><td> stream </td><td> com.opensymphony.webwork.dispatcher.StreamResult </td>
|
||||
</tr>
|
||||
</table><br/>
|
||||
结果在xwork.xml中指定并嵌套在<action>中. 如果你只需要指定"location"属性, 可以使用简写形式:<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><action name=<span class="xml-quote">"bar"</span> class=<span class="xml-quote">"myPackage.barAction"</span>></span> <span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"dispatcher"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"location"</span>></span>foo.jsp<span class="xml-tag"></param></span> <span class="xml-tag"></result></span> <span class="xml-tag"></action></span></pre>
|
||||
</div></div><p class="paragraph">或简写为</p><div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><action name=<span class="xml-quote">"bar"</span> class=<span class="xml-quote">"myPackage.barAction"</span>></span> <span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"dispatcher"</span>></span>foo.jsp<span class="xml-tag"></result></span> <span class="xml-tag"></action></span></pre>
|
||||
</div></div><p class="paragraph">如果你扩展了webwork-default.xml, 那么缺省结果类型是"dispatcher". 如果你不指定结果名字, 它将被指定为"success". 这意味着你个一进一步简写</p><div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><action name=<span class="xml-quote">"bar"</span> class=<span class="xml-quote">"myPackage.barAction"</span>></span> <span class="xml-tag"><result></span>foo.jsp<span class="xml-tag"></result></span> <span class="xml-tag"></action></span></pre>
|
||||
</div></div><p class="paragraph"><ins class="inserted">注意:</ins> location元素将作为表达式进行解析. 下面的例子说明了这样做的好处:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"redirect"</span>></span>/displayCart.action?userId=${userId}<span class="xml-tag"></result></span></pre>
|
||||
</div></div></p><ins class="inserted">注意:</ins> 你也可以为多个活动指定全局结果. 当你为多个不同活动设置相同的属性时, 这能节省一些时间. 关于结果和全局结果的更多信息, 参见<a href="Results.html" title="Results">结果</a>一节.<br/>
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,60 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : 结果</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : 结果
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 13, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h2 style="margin: 4px 0px 4px 0px;" class="heading2"><a name="Results-Overview"> 综述</a></h2></p>结果是活动返回的字符串常量, 表述活动的执行情况. WebWork缺省定义了一个标准结果集: error, input, login, none and success. 当然, 开发着可以只有的定义自己的结果以表述其他应用状态. 结果使用名值对的结构映射到<a href="Result Types.html" title="Result Types">结果类型</a>.
|
||||
<ul class="star">
|
||||
<li> <a href="Global results.html" title="Global results">全局结果</a></li>
|
||||
<li> <a href="Default results.html" title="Default results">缺省结果</a></li>
|
||||
</ul>
|
||||
<h3 class="heading3"><a name="Results-Resulttags"> Result元素</a></h3><p class="paragraph"Result元素告诉WebWork活动执行后下一步该做什么. 下面是WebWork内置的标准结果代码(定义在Action接口中), 包括:
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="java-object">String</span> SUCCESS = <span class="java-quote">"success"</span>; <span class="java-object">String</span> NONE = <span class="java-quote">"none"</span>; <span class="java-object">String</span> ERROR = <span class="java-quote">"error"</span>; <span class="java-object">String</span> INPUT = <span class="java-quote">"input"</span>; <span class="java-object">String</span> LOGIN = <span class="java-quote">"login"</span>;</pre>
|
||||
</div></div></p>你可以扩充你认为适合的结果代码(如"missing-data"). 大多数情况下你只需使用SUCCESS和ERROR, SUCCESS将前进到下一个页面;
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"dispatcher"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"location"</span>></span>/thank_you.jsp<span class="xml-tag"></param></span> <span class="xml-tag"></result></span></pre>
|
||||
</div></div><p class="paragraph"><b class="strong">ERROR</b>将前进到错误页面, 或前一个页面;
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><result name=<span class="xml-quote">"error"</span> type=<span class="xml-quote">"dispatcher"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"location"</span>></span>/error.jsp<span class="xml-tag"></param></span> <span class="xml-tag"></result></span></pre>
|
||||
</div></div></p>结果在xwork.xml中指定并嵌套在<action>中. 如果你只需要指定"location"属性, 可以使用简写形式:<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><action name=<span class="xml-quote">"bar"</span> class=<span class="xml-quote">"myPackage.barAction"</span>></span> <span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"dispatcher"</span>></span> <span class="xml-tag"><param name=<span class="xml-quote">"location"</span>></span>foo.jsp<span class="xml-tag"></param></span> <span class="xml-tag"></result></span> <span class="xml-tag"></action></span></pre>
|
||||
</div></div><br/>
|
||||
或更简单
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><action name=<span class="xml-quote">"bar"</span> class=<span class="xml-quote">"myPackage.barAction"</span>></span> <span class="xml-tag"><result name=<span class="xml-quote">"success"</span> type=<span class="xml-quote">"dispatcher"</span>></span>foo.jsp<span class="xml-tag"></result></span> <span class="xml-tag"></action></span></pre>
|
||||
</div></div><br/>
|
||||
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,95 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>WebWork 2 : Select标签</title>
|
||||
<link rel="stylesheet" href="styles/site.css" type="text/css" />
|
||||
<META http-equiv="Content-Type" content="text/html; charset=GBK">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
|
||||
<tr>
|
||||
<td valign="top" class="pagebody">
|
||||
<div class="pageheader">
|
||||
<span class="pagetitle">
|
||||
WebWork 2 : Select标签
|
||||
</span>
|
||||
</div>
|
||||
<div class="pagesubheading">
|
||||
This page last changed on Dec 14, 2004 by <font color="#0050B2">casey</font>.
|
||||
</div>
|
||||
|
||||
<p class="paragraph"><h3 style="margin: 4px 0px 4px 0px;" class="heading3"><a name="Selecttag-%26lt%3Bww%3Aselect%2F%26gt%3B"> <ww:select /></a></h3></p>生成一个SELECT选项列表. quot;listKey"属性是列表中每个元素的用于生成<option>标签中value的属性. "listValue"属性填充option的文本标签(显示名称). 一大特性是根据"value"属性自动选中适当的选项. 如果value于当前listKey相等, 该选项设为selected(如果类型符合的话; 见下文).<br/>
|
||||
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww:select label=<span class="xml-quote">"'Users'"</span> name=<span class="xml-quote">"'userId'"</span> listKey=<span class="xml-quote">"id"</span> listValue=<span class="xml-quote">"name"</span> list=<span class="xml-quote">"app.users"</span> value=<span class="xml-quote">"app.user.id"</span> onchange=<span class="xml-quote">"'chooseUser(this)'"</span> /></span></pre>
|
||||
</div></div><p class="paragraph">将生成下列结果(假设getApp().getUser().getId() == 2):
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><tr></span> <span class="xml-tag"><td></span>Users<span class="xml-tag"></td></span> <span class="xml-tag"><td></span> <span class="xml-tag"><select name=<span class="xml-quote">"userId"</span> onchange=<span class="xml-quote">"chooseUser(this)"</span>></span> <span class="xml-tag"><option value=<span class="xml-quote">"1"</span>></span> User Number One <span class="xml-tag"></option></span> <span class="xml-tag"><option value=<span class="xml-quote">"2"</span> selected=<span class="xml-quote">"selected"</span>></span> User Number Two <span class="xml-tag"></option></span> <span class="xml-tag"></select></span> <span class="xml-tag"><td></span> <span class="xml-tag"></tr></span></pre>
|
||||
</div></div></p>当然, <td>等格式依赖于你使用的<a href="Themes.html" title="Themes">模版</a>.<p class="paragraph"><b class="strong">用法示例</b>
|
||||
<div class="code"><div class="codeContent">
|
||||
<pre><span class="xml-tag"><ww:select label=<span class="xml-quote">"'Pets'"</span> name=<span class="xml-quote">"'petIds'"</span> list=<span class="xml-quote">"petDao.pets"</span> listKey=<span class="xml-quote">"id"</span> listValue=<span class="xml-quote">"name"</span> multiple=<span class="xml-quote">"true"</span> size=<span class="xml-quote">"3"</span> required=<span class="xml-quote">"true"</span> /></span> <span class="xml-tag"><ww:select label=<span class="xml-quote">"'Months'"</span> name=<span class="xml-quote">"'months'"</span> list=<span class="xml-quote">"#{'01':'Jan', '02':'Feb', [...]}"</span> value=<span class="xml-quote">"selectedMonth"</span> required=<span class="xml-quote">"true"</span> /></span> // The month id (01, 02, ...) returned by the getSelectedMonth() call // against the stack will be auto-selected</pre>
|
||||
</div></div></p>注意: 对于任何使用列表数据的标签(select可能是最常见的), 它使用OGNL的列表表示法(参见上面的例子"months"), 注意的是, 这里键值(在months例子中是'01', '02'等等)是手工输入的. '1'是字符, '01'是字符串, "1"是字符串. 如果"value"属性返回的值和"列表"中的键值类型不同时, 即使字符串值相同, 也无法匹配. 如果无法匹配, 列表中将没有自动选中的选项.<p class="paragraph"><b class="strong">属性</b>
|
||||
<table class="wikitable">
|
||||
<tr>
|
||||
<th> 名字 </th><th> 必需 </th><th> 描述 </th>
|
||||
</tr><tr>
|
||||
<td> id </td><td> 否 </td><td> HTML的id属性 </td>
|
||||
</tr><tr>
|
||||
<td> name </td><td> <b class="strong">是</b> </td><td> HTML的name属性 </td>
|
||||
</tr><tr>
|
||||
<td> value </td><td> 否 </td><td> 字段值 </td>
|
||||
</tr><tr>
|
||||
<td> list </td><td> 否 </td><td> 列表使用的可迭代数据源, 如果烈表是Map (key, value), key将作为option的value, value作为它的内容(body)</td>
|
||||
</tr><tr>
|
||||
<td> listKey </td><td> 否 </td><td> 列表对象的键值属性 </td>
|
||||
</tr><tr>
|
||||
<td> listValue </td><td> 否 </td><td> 列表对象的内容属性 </td>
|
||||
</tr><tr>
|
||||
<td> headerKey </td><td> 否 </td><td> 第一个选项的建值 </td>
|
||||
</tr><tr>
|
||||
<td> headerValue </td><td> 否 </td><td> 第一个选项的值 </td>
|
||||
</tr><tr>
|
||||
<td> emptyOption </td><td> 否 </td><td> 是否在选项头(header option)后加入空白(--)选项 </td>
|
||||
</tr><tr>
|
||||
<td> multiple </td><td> 否 </td><td> 是否允许多选? </td>
|
||||
</tr><tr>
|
||||
<td> size </td><td> 否 </td><td> HTML的size属性</td>
|
||||
</tr><tr>
|
||||
<td> disabled </td><td> 否 </td><td> HTML的disabled属性 </td>
|
||||
</tr><tr>
|
||||
<td> tabindex </td><td> 否 </td><td> HTML的tabindex属性</td>
|
||||
</tr><tr>
|
||||
<td> onchange </td><td> 否 </td><td> HTML的onchange属性 </td>
|
||||
</tr><tr>
|
||||
<td> onclick </td><td> 否 </td><td> HTML的onclick属性 </td>
|
||||
</tr><tr>
|
||||
<td> label </td><td> 否 </td><td> 用于模版中的标签文字 </td>
|
||||
</tr><tr>
|
||||
<td> labelposition </td><td> 否 </td><td> 标签的对齐方式 (left,right,center) </td>
|
||||
</tr><tr>
|
||||
<td> required </td><td> 否 </td><td> 在表单提交时是否是必需字段 </td>
|
||||
</tr><tr>
|
||||
<td> cssClass </td><td> 否 </td><td> HTML的class属性 </td>
|
||||
</tr><tr>
|
||||
<td> cssStyle </td><td> 否 </td><td> HTML的style属性 </td>
|
||||
</tr><tr>
|
||||
<td> theme </td><td> 否 </td><td> 使用的主题 </td>
|
||||
</tr><tr>
|
||||
<td> template </td><td> 否 </td><td> 使用的模版名 </td>
|
||||
</tr>
|
||||
</table></p>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td height="12" background="border/border_bottom.gif"><img src="border/spacer.gif" width="1" height="1" border="0"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center"><font color="grey">Document generated by Confluence on Dec 14, 2004 16:36</font></td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user