1. opensymphony
  2. webwork

Commits

rainerh  committed 90d2995

WebWork 2.2.2 release: Adding wikidocs for release 2.2.2
o ivy, pom & build.properties
Issue number:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@2558573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits 9808b10
  • Branches master
  • Tags webwork_2-2-2

Comments (0)

Files changed (4)

File docs/wikidocs/Action configuration.html

View file
+<html>
+    <head>
+        <title>WebWork - 
+        Action configuration
+         </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">
+				    <p>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. saveForm.action) and the corresponding "handler" class.</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;action name=<span class="code-quote">"formTest"</span> class=<span class="code-quote">"com.opensymphony.webwork.example.FormAction"</span> method=<span class="code-quote">"processForm"</span>&gt;</span></pre>
+</div></div>
+
+<p>The optional "<b>method</b>" parameter tells WebWork which method to call based upon this action. If you leave the method parameter blank, WebWork will call the method <b>execute()</b> by default. If there is no execute() method and no method specified in the xml file, WebWork will throw an exception.</p>
+
+<p>Also, you can tell WebWork to invoke "<b>doSomething</b>"  method in your action by using the pattern "<b>actionName&#33;something</b>" in your form.  For example, "<b>formTest&#33;save.action</b>" will invoke the method "<b>save</b>" in FormAction class.  The method must be public, take no arguments and also returns a String which indicate the name of the result to be executed:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-keyword">public</span> <span class="code-object">String</span> save() <span class="code-keyword">throws</span> Exception
+  {
+      ...
+      <span class="code-keyword">return</span> SUCCESS;
+  }</pre>
+</div></div>
+<p>&nbsp;</p>
+
+<p>All the configuration for "<b>actionName</b>" will be used for "actionName&#33;something" (interceptors, result types, etc...)</p>
+
+
+<h2><a name="Actionconfiguration-ActionSupport"></a>Action Support</h2>
+
+<p>Action class attribute could be left out such as following </p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">&lt;action name=<span class="code-quote">"myAction"</span>&gt;
+   ....
+&lt;/action&gt;</pre>
+</div></div>
+
+<p>In this case, the class will default to com.opensymphony.xwork.ActionSupport which have an execute() method that returns SUCCESS by default.</p>
+
+
+<h2><a name="Actionconfiguration-DefaultActionReference"></a>Default Action Reference</h2>
+
+<p>Since Webwork 2.2.1 you are also able to specify a default action to be executed when no other action is matched in the xwork.xml.  This feature is provided mainly to eliminate the need to create an action class and/or element for very simple or similar results.&nbsp; The default action name can be set inside the package element like below:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;package name=<span class="code-quote">"myPackage"</span> ....&gt;</span>
+
+...
+
+<span class="code-tag">&lt;default-action-ref name=<span class="code-quote">"simpleViewResultAction"</span>&gt;</span>
+
+&lt;!-- 
+An example of a default action that is just a simple class 
+that has 3 fields: successUrl, errorUrl, and inputUrl.  This action 
+parses the request url to set the result values.  In the normal case 
+it just renders velocity results of the same name as the requested url.
+--&gt;
+<span class="code-tag">&lt;action name=<span class="code-quote">"simpleViewResultAction"</span> class=<span class="code-quote">"SimpleViewResultAction"</span>&gt;</span>
+	<span class="code-tag">&lt;result type=<span class="code-quote">"velocity"</span>&gt;</span>${successUrl}<span class="code-tag">&lt;/result&gt;</span>
+	<span class="code-tag">&lt;result name=<span class="code-quote">"error"</span> type=<span class="code-quote">"velocity"</span>&gt;</span>${errorUrl}<span class="code-tag">&lt;/result&gt;</span>
+	<span class="code-tag">&lt;result name=<span class="code-quote">"input"</span> type=<span class="code-quote">"velocity"</span>&gt;</span>${inputUrl}<span class="code-tag">&lt;/result&gt;</span>
+<span class="code-tag">&lt;/action&gt;</span>
+
+... 
+
+<span class="code-tag">&lt;/package&gt;</span></pre>
+</div></div>
+<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Caution</b><br /><br/>
+This feature should be configured such that there is only one default action per namespace.  Therefore if you have multiple packages declaring a default action with the same namespace, it is not guaranteed which action will be the default.</td></tr></table>
+<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Note</b><br />
+<p>Note that the name attribute is left out for the first result, as WebWork will default to "success" if it is left out. </p></td></tr></table>
+
+<p>In this case any request to action not defined in this package will automatically trigger action with alias "simpleViewResultAction" to be executed.</p>
+
+
+<p>Most of the content here provided by Matt Dowell &lt;matt.dowell@notiva.com&gt;</p>
+
+                    			    </td>
+		    </tr>
+	    </table>
+    </body>
+</html>

File docs/wikidocs/Asynchronous processing with WebWork - XWork_attachments/async-web kt.ppt

Binary file added.

File docs/wikidocs/Asynchronous processing with WebWork - XWork_attachments/async.zip

Binary file added.

File docs/wikidocs/SiteMesh.html

View file
+<html>
+    <head>
+        <title>WebWork - 
+        SiteMesh
+         </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">
+				    <h2><a name="SiteMesh-Overview"></a>Overview</h2>
+
+<p><a href="http://www.opensymphony.com/sitemesh" title="Visit page outside Confluence">SiteMesh</a> is a web-page layout and decoration framework and web- application integration framework to aid in creating large sites consisting of many pages for which a consistent look/feel, navigation and layout scheme is required.</p>
+
+<p>Integrating WebWork with SiteMesh is amazingly simple: you don't have to do anything in fact. WebWork stores all its value stack information in the request attributes, meaning that if you wish to display data that is in the stack (or even the ActionContext) you can do so by using the normal tag libraries that come with WebWork. That's it!</p>
+
+<h2><a name="SiteMesh-ActionContextCleanUp"></a>ActionContextCleanUp</h2>
+
+<p>In WebWork's <a href="Architecture.html" title="Architecture">Architecture</a>, the standard filter-chain optionally starts with the <b>ActionContextCleanUp</b> filter, followed by other desired filters. Lastly, the <b>FilterDispatcher</b> handles the request, usually passing it on to the ActionMapper. The primary purpose of the <b>ActionContextCleanUp</b> is for SiteMesh integration. This tells the FilterDispatcher when exactly, to clean-up the request. Otherwise, the ActionContext may be removed before the decorator attempts to access it.</p>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='warningMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Warning</b><br /><em>If</em> ActionContext access is required within the decorators, the <b>ActionContextCleanUp</b> filter <em>must</em> be placed at the beginning of the filter-chain. </td></tr></table>
+
+<p>For more information, see the javadocs of the ActionContextCleanUp filter:</p>
+
+<p>Special filter designed to work with the FilterDispatcher and allow
+for easier integration with SiteMesh. Normally, ordering your filters to have
+SiteMesh go first, and then FilterDispatcher go second is perfectly fine.
+However, sometimes you may wish to access WebWork-features, including the
+value stack, from within your SiteMesh decorators. Because FilterDispatcher
+cleans up the ActionContext, your decorator won't have access to the
+date you want.
+<p/>
+<p/>
+By adding this filter, the FilterDispatcher will know to not clean up and
+instead defer cleanup to this filter. The ordering of the filters should then be:
+<p/>
+<ul>
+<li>this filter</li>
+<li>SiteMesh filter</li>
+<li>FilterDispatcher</li>
+</ul></p>
+
+<h2><a name="SiteMesh-VelocityandFreeMarkerDecorators"></a>Velocity and FreeMarker Decorators</h2>
+
+<p>WebWork provides extension of the SiteMesh PageFilter that assist with integration with <a href="Velocity.html" title="Velocity">Velocity</a> and <a href="FreeMarker.html" title="FreeMarker">FreeMarker</a>. We strongly recommend using these filters, instead of the support provided by SiteMesh, because they also will provide the standard variables and <a href="Tags.html" title="Tags">Tags</a> that you are used to when created views in your favoriate template language.</p>
+
+<h3><a name="SiteMesh-Velocity"></a>Velocity</h3>
+
+<p>If you are using Velocity for your SiteMesh decorators, we recommend using the VelocityPageFilter. This is an extension of the SiteMesh PageFilter, which should be placed in the web.xml in between the <b>ActionContextCleanUp</b> and the <b>FilterDispatcher</b>. Now the Velocity decorators will have access to WebWork variables such as $stack and $request.</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;filter&gt;</span>
+    <span class="code-tag">&lt;filter-name&gt;</span>webwork-cleanup<span class="code-tag">&lt;/filter-name&gt;</span>
+    <span class="code-tag">&lt;filter-class&gt;</span>com.opensymphony.webwork.dispatcher.ActionContextCleanUp<span class="code-tag">&lt;/filter-class&gt;</span>
+<span class="code-tag">&lt;/filter&gt;</span>
+<span class="code-tag">&lt;filter&gt;</span>
+    <span class="code-tag">&lt;filter-name&gt;</span>sitemesh<span class="code-tag">&lt;/filter-name&gt;</span>
+    <span class="code-tag">&lt;filter-class&gt;</span>com.opensymphony.webwork.sitemesh.VelocityPageFilter<span class="code-tag">&lt;/filter-class&gt;</span>
+<span class="code-tag">&lt;/filter&gt;</span>
+<span class="code-tag">&lt;filter&gt;</span>
+    <span class="code-tag">&lt;filter-name&gt;</span>webwork<span class="code-tag">&lt;/filter-name&gt;</span>
+    <span class="code-tag">&lt;filter-class&gt;</span>com.opensymphony.webwork.dispatcher.FilterDispatcher<span class="code-tag">&lt;/filter-class&gt;</span>
+<span class="code-tag">&lt;/filter&gt;</span>
+
+<span class="code-tag">&lt;filter-mapping&gt;</span>
+    <span class="code-tag">&lt;filter-name&gt;</span>webwork-cleanup<span class="code-tag">&lt;/filter-name&gt;</span>
+    <span class="code-tag">&lt;url-pattern&gt;</span>/*<span class="code-tag">&lt;/url-pattern&gt;</span>
+<span class="code-tag">&lt;/filter-mapping&gt;</span>
+<span class="code-tag">&lt;filter-mapping&gt;</span>
+    <span class="code-tag">&lt;filter-name&gt;</span>sitemesh<span class="code-tag">&lt;/filter-name&gt;</span>
+    <span class="code-tag">&lt;url-pattern&gt;</span>/*<span class="code-tag">&lt;/url-pattern&gt;</span>
+<span class="code-tag">&lt;/filter-mapping&gt;</span>
+<span class="code-tag">&lt;filter-mapping&gt;</span>
+    <span class="code-tag">&lt;filter-name&gt;</span>webwork<span class="code-tag">&lt;/filter-name&gt;</span>
+    <span class="code-tag">&lt;url-pattern&gt;</span>/*<span class="code-tag">&lt;/url-pattern&gt;</span>
+<span class="code-tag">&lt;/filter-mapping&gt;</span></pre>
+</div></div>
+
+
+<h3><a name="SiteMesh-FreeMarker"></a>FreeMarker </h3>
+
+<p>If you are using FreeMarker for your SiteMesh decorators, we recommend using the FreeMarkerPageFilter. This is an extension of the SiteMesh PageFilter, which should be placed in the web.xml in between the <b>ActionContextCleanUp</b> and the <b>FilterDispatcher</b>. Now the FreeMarker decorators will have access to WebWork variables such as ${stack} and ${request}.</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-xml"><span class="code-tag">&lt;filter&gt;</span>
+    <span class="code-tag">&lt;filter-name&gt;</span>webwork-cleanup<span class="code-tag">&lt;/filter-name&gt;</span>
+    <span class="code-tag">&lt;filter-class&gt;</span>com.opensymphony.webwork.dispatcher.ActionContextCleanUp<span class="code-tag">&lt;/filter-class&gt;</span>
+<span class="code-tag">&lt;/filter&gt;</span>
+<span class="code-tag">&lt;filter&gt;</span>
+    <span class="code-tag">&lt;filter-name&gt;</span>sitemesh<span class="code-tag">&lt;/filter-name&gt;</span>
+    <span class="code-tag">&lt;filter-class&gt;</span>com.opensymphony.webwork.sitemesh.FreeMarkerPageFilter<span class="code-tag">&lt;/filter-class&gt;</span>
+<span class="code-tag">&lt;/filter&gt;</span>
+<span class="code-tag">&lt;filter&gt;</span>
+    <span class="code-tag">&lt;filter-name&gt;</span>webwork<span class="code-tag">&lt;/filter-name&gt;</span>
+    <span class="code-tag">&lt;filter-class&gt;</span>com.opensymphony.webwork.dispatcher.FilterDispatcher<span class="code-tag">&lt;/filter-class&gt;</span>
+<span class="code-tag">&lt;/filter&gt;</span>
+
+<span class="code-tag">&lt;filter-mapping&gt;</span>
+    <span class="code-tag">&lt;filter-name&gt;</span>webwork-cleanup<span class="code-tag">&lt;/filter-name&gt;</span>
+    <span class="code-tag">&lt;url-pattern&gt;</span>/*<span class="code-tag">&lt;/url-pattern&gt;</span>
+<span class="code-tag">&lt;/filter-mapping&gt;</span>
+<span class="code-tag">&lt;filter-mapping&gt;</span>
+    <span class="code-tag">&lt;filter-name&gt;</span>sitemesh<span class="code-tag">&lt;/filter-name&gt;</span>
+    <span class="code-tag">&lt;url-pattern&gt;</span>/*<span class="code-tag">&lt;/url-pattern&gt;</span>
+<span class="code-tag">&lt;/filter-mapping&gt;</span>
+<span class="code-tag">&lt;filter-mapping&gt;</span>
+    <span class="code-tag">&lt;filter-name&gt;</span>webwork<span class="code-tag">&lt;/filter-name&gt;</span>
+    <span class="code-tag">&lt;url-pattern&gt;</span>/*<span class="code-tag">&lt;/url-pattern&gt;</span>
+<span class="code-tag">&lt;/filter-mapping&gt;</span></pre>
+</div></div>
+
+                    			    </td>
+		    </tr>
+	    </table>
+    </body>
+</html>