webwork/src/docs/manual fundamentals-command.html,NONE,1.1 fundamentals-configure.html,1.3,1.4 index.html,1.9,1.10
[email protected] Sun, 02 Nov 2003 09:48:00 -0800
| Newsgroups | gmane.comp.java.open-symphony.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/opensymphony/webwork/src/docs/manual
In directory sc8-pr-cvs1:/tmp/cvs-serv16129/src/docs/manual
Modified Files:
fundamentals-configure.html index.html
Added Files:
fundamentals-command.html
Log Message:
talk about commons-logging, not log4j
Added a bit about commands
--- NEW FILE: fundamentals-command.html ---
Commands are a useful feature of WebWork that allow you to use one action class to perform a variety of tasks.
<p>
A command allows you to specify do* methods to be invoked on your action, instead of doExecute. The power of
commands is best illustrated with an example. Suppose your action handles a 'wizard' type component. This involves
moving through a sequence of pages, performing various checks and validation on the way. At some point in the process,
you would like to send an email.
<p>
you can achieve that through defining a <code>doEmail</code> method in your action. Then in your form, you would simply
call this method by setting the url to youraction!email. The ! character is used to denote command execution, and any
do* command method can be invoked this way. Note that when a command is explicitly invoked, doValidation is not called.
If you need to validate input before calling a command, you will need to do so explicitly in your command method.
Index: fundamentals-configure.html
===================================================================
RCS file: /cvsroot/opensymphony/webwork/src/docs/manual/fundamentals-configure.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- fundamentals-configure.html 1 Nov 2003 03:25:10 -0000 1.3
+++ fundamentals-configure.html 2 Nov 2003 17:47:58 -0000 1.4
@@ -19,15 +19,17 @@
This comma separated list tells WW to look for the property files views.properties,
webwork.properties, and default.properties. You will define the file webwork.properties
to override any property setting in default.properties and to define new properties for
-your applicaiton. You will provide views.properties to define your views.</p>
+your application. You will provide views.properties to define your views.</p>
-<p>Listed below are the list of properties WW recognizes these properties:</p>
+<p>Listed below are properties that WW recognizes:</p>
<b>Properties</b>
<ul>
<li><em>webwork.action.packages</em> - When you refer to actions in URLs, you may include the absolute or
a relative package name. If you use a relative name, WW will prefix the name with your list
- of prefixes to see if it can find the action. You will normally override this property.</li>
+ of prefixes to see if it can find the action. You will normally override this property. So for example,
+ your webwork.action.packages value might be <pre>webwork.action.packages=com.acme.action,com.mydomain.action</pre>.
+ </li>
<li><em>webwork.action.factory</em> - The action factory WW will use to retrieve the desired action.
DefaultActionFactory is the default. It chains together factories to provide a chain of responsibility.
It will ask the first factory in the chain for the action. This factory will either return the appropriate
@@ -43,9 +45,12 @@
it by setting its = to nothing if you do not want WW to configure log4j. </li>
<li><em>webwork.action.extension</em> - The extension WW will use to identify an action. You will need to modify your
web.xml as well if you change it from the default “action.” </li>
- <li><em>webwork.multipart.parser</em> - The parser WW should use for multi-part content.</li>
+ <li><em>webwork.multipart.parser</em> - The parser WW should use for multi-part content. Valid options are cos,
+ and pell. The functionality between the two parsers is mostly the same. One main difference however is the licensing
+ terms; cos requires that you buy a copy of Jason Hunter's servlet book (more details
+ <a href="http://www.servlets.com/cos/index.html">here</a>), while the pell multipart parser is under the LGPL.</li>
<li><em>webwork.multipart.saveDir</em> - The directory WW should save the multi-part content to.</li>
- <li><em>webwork.multipart.maxSize</em> - The maximum file size WW will allow for multi-part content.</li>
+ <li><em>webwork.multipart.maxSize</em> - The maximum file size WW will allow for multi-part content in bytes.</li>
</ul>
<p>See <a href="default.properties">Default Configuration</a> for an example configuration setting that WW uses by default.
@@ -73,7 +78,7 @@
<p>Listed below is an example of a views.properties file. Note, <em>Test!foo</em> defines a command driven action.
This means alias testfoo.action will cause WW to retrieve action Test and invoke method doFoo.
The return value will be success and WW will then resolve alias testfoo.success and test.jsp will be rendered.
-See the <a href="howto-wizard.html">Wizards</a> for more information.
+See <a href="commands.html">Commands</a> for more information about action commands.
</p>
<em>testfoo.action=Test!foo<br>
@@ -84,25 +89,29 @@
file named <em>actions.xml</em>. By default, WW will read in any views defined in this file.
Here is an example of an actions.xml file.</p>
-Here is an example <a href="actions.xml">actions.xml</a> file.
+Here is an example <a href="actions.xml.txt">actions.xml</a> file.
<p>The DTD for this XML configuration file can be found in the file /etc/<a href="actions.dtd">actions.dtd</a>
in your WebWork distribution.</p>
<p>The algorithm used to find a view from your configuration file is as follows:</p>
<ol>
-It queries the configuration for the actionName.viewName entry. If found, then that is used.
+First, the configuration is checked for a actionName.viewName entry. If found, then that is used.
If not found, then parts of the action name are removed until a match is found.
-For example, suppose we have a view mapping shown below and an action foo.bar was executed and it returned SUCCESS, WW would look for foo.bar.success. However, it would not find a match so the algorithm would remove bar and look for foo.success and it will find a match. This allows you to define global mappings for login, error, success, or whatever you want.
+For example, suppose we have a view mapping shown below and an action foo.bar was executed and it returned SUCCESS,
+WW would look for foo.bar.success. However, it would not find a match so the algorithm would remove bar and look
+for foo.success and it will find a match. This allows you to define global mappings for login, error,
+ success, or whatever you want.
</ol>
<pre>foo.success=foo.jsp</pre>
<a name="logger"><h3>Logger</h3></a>
-<p>WW uses <a href="http://jakarta.apache.org/log4j/docs/index.html">log4j</a> as its logger.
-This is a powerful, flexible logger that provide a logging service to applications.
-WW configures its logger by a property file named <em>log4j.properties</em> which is listed below.</p>
-
+<p>WW uses <a href="http://jakarta.apache.org/commons/logging.html">commons-logging</a> as its logger.
+This is a a wrapping logger that will use log4j or the JDK 1.4 logging API depending on which is available.
+The configuration of commons-logging happens through a discovery mechanism; if log4j is found in your classpath
+then the log4j logging system will be loaded, and an appropriate log4j.properties file should exist in your classpath.
+An example of a log4j.properties configuration file is provided below.</p>
<pre>
# A log4j properties file
### The WebWork console appender
@@ -120,9 +129,10 @@
This action provides a protected log attribute for you to use to write out logs from within your actions.</p>
<b>How do I log to a file?</b>
-<p>The easiest thing is to override WW's <em>webwork.log4j.configfile</em> property with a log4j configuration that meets your needs.
-You can specify either a property or XML file.</p>
-
+<p>Customize your logging file and add suitable appenders or handlers that will log to a file. See
+<a href="http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/overview.html">here</a> for information on
+the JDK 1.4 logging API (with some examples on how to log to a file), or
+<a href="http://jakarta.apache.org/log4j/docs/manual.html"></a> for information on configuring log4j.</p>
</body>
</html>
Index: index.html
===================================================================
RCS file: /cvsroot/opensymphony/webwork/src/docs/manual/index.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- index.html 8 Nov 2002 10:18:17 -0000 1.9
+++ index.html 2 Nov 2003 17:47:58 -0000 1.10
@@ -40,6 +40,9 @@
<li><a href="fundamentals-model12.html#when">When to use what?</a></li>
</ul>
<li><a href="fundamentals-action.html">Action API</a></li>
+ <ul>
+ <li><a href="fundamentals-command.html">Action Commands</a></li>
+ </ul>
<li><a href="fundamentals-valuestack.html">Value Stack</a></li>
<ul>
<li><a href="fundamentals-valuestack.html#what">What is it?</a></li>
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/