- Revision
- 635
- Author
- mauro
- Date
- 2008-04-20 09:59:52 -0500 (Sun, 20 Apr 2008)
Log Message
Updated documentation.
Modified Paths
- trunk/waffle-distribution/src/site/content/action-methods.html
- trunk/waffle-distribution/src/site/content/tutorials/tutorial-two.html
- trunk/waffle-distribution/src/site/content/views.html
Diff
Modified: trunk/waffle-distribution/src/site/content/action-methods.html (634 => 635)
--- trunk/waffle-distribution/src/site/content/action-methods.html 2008-04-20 14:34:51 UTC (rev 634) +++ trunk/waffle-distribution/src/site/content/action-methods.html 2008-04-20 14:59:52 UTC (rev 635) @@ -264,10 +264,10 @@ <ul> <li><b>View</b> - An ActionMethod which returns an instance of <i><a href="" - org.codehaus.waffle.view.View</a></i> or - <i><a href="" - org.codehaus.waffle.view.RedirectView</a></i> will forward or redirect, respectively. By default Waffle assumes - that each View defines the full URL the user is to be sent to. This behavior can be altered by definning a + org.codehaus.waffle.view.View</a></i> (or its subtypes <i><a href="" + org.codehaus.waffle.view.RedirectView</a></i> and <i><a href="" + org.codehaus.waffle.view.ExportView</a></i>) will forward, redirect or export content, respectively. By default Waffle assumes + that each View defines the full URL the user is to be sent to. This behavior can be altered by defining a different implementation of the <i><a href="" org.codehaus.waffle.view.ViewResolver</a></i>. Waffle was built to be pluggable this is the first example of how Waffle components can be customized and configured. Read the section on
Modified: trunk/waffle-distribution/src/site/content/tutorials/tutorial-two.html (634 => 635)
--- trunk/waffle-distribution/src/site/content/tutorials/tutorial-two.html 2008-04-20 14:34:51 UTC (rev 634) +++ trunk/waffle-distribution/src/site/content/tutorials/tutorial-two.html 2008-04-20 14:59:52 UTC (rev 635) @@ -209,35 +209,8 @@ <h4>ActionMethod return types</h4> <p>Waffle will react differently depending on what is returned, or -thrown, from an <b>ActionMethod</b> after it has been invoked. Below we -define defines how each case is handled in the Waffle framework:</p> -<ul> - <li><b>View</b> - An ActionMethod which returns an instance of <i><a href="" - org.codehaus.waffle.view.View</a></i> - or <i><a href="" - org.codehaus.waffle.view.RedirectView</a></i> will forward or - redirect, respectively. By default Waffle assumes that each View - defines the full URL the user is to be sent to. This behavior can be - altered by definning a different implementation of the <i><a href="" - org.codehaus.waffle.view.ViewResolver</a></i>. - Waffle was built to be pluggable this is the first example of how - Waffle components can be customized and configured. Read the section - on Waffle's <a href="" for further - details.</li> - <li><b>null or void</b> - When an ActionMethod has a return type - of <i>void</i> or when your ActionMethod returns a <i>null</i> Waffle - will simply redirect back to the referring page.</li> - <li><b>Exception</b> - When an exception is thrown Waffle will - set the response status to 400 (BAD REQUEST) and then send the - contents of the message directly to the requestor. This functionality - is especially useful when handling Ajax type of requests.</li> - <li><b>Other</b> - All other objects will have their toString() - method called and the resulting value will be sent back to the - requestor. This is similar to how Exceptions are handled, without the - response status being set to an error code. This is useful for Ajax - type of requests. Imagine these type of ActionMethod returning HTML or - JSON messages directly.</li> -</ul> +thrown, from an <b>ActionMethod</b> after it has been invoked. See <a href="" Methods</a> for more details. +</p> <h4>Caveat: Ambiguous methods</h4> <p>Waffle determines which ActionMethod to invoke by examining the
Modified: trunk/waffle-distribution/src/site/content/views.html (634 => 635)
--- trunk/waffle-distribution/src/site/content/views.html 2008-04-20 14:34:51 UTC (rev 634) +++ trunk/waffle-distribution/src/site/content/views.html 2008-04-20 14:59:52 UTC (rev 635) @@ -6,10 +6,10 @@ <body> <h2>Views</h2> -<p>With Waffle you can write views with either Java Server Pages, -FreeMarker or Velocity. Other view technologies, like Tiles will also -work. Decoration technologies like Sitemesh are quite compatible with -Waffle (see our Freemarker example).</p> +<p>With Waffle you can write views with either Java Server Pages (JSP), +FreeMarker or Velocity. Other view technologies, like Tiles or +Sitemesh are compatible with Waffle (eg cf our Freemarker example).</p> + <h3>Java Server Pages</h3> <p>Using Java Server Pages in Waffle is as easy as it is with other frameworks. You'll be able to reference the Controller that is @@ -44,21 +44,26 @@ <servlet-name>waffle</servlet-name> <servlet-class>org.codehaus.waffle.servlet.WaffleServlet</servlet-class> <init-param> - <description>Optional, by deafult '/' (root) is used.</description> + <description>Optional, by default '/' (root) is used.</description> <param-name>view.prefix</param-name> <param-value>/WEB-INF/jsp</param-value> </init-param> <init-param> + <description>Optional, by default '.jspx' is used.</description> <param-name>view.suffix</param-name> <param-value>.jspx</param-value> </init-param> + <init-param> + <description>Optional, by default 'errors' is used.</description> + <param-name>errors.view</param-name> + <param-value>errors</param-value> + </init-param> <load-on-startup>1</load-on-startup> </servlet> </textarea> -<p>Note that .jspx being the default view suffix for Waffle, the -'init-param' for it could be left out entirely (and is in some our -examples).</p> +<p>Note that all view configuration <code>init-param</code>s are optional, +(and this is why they are left out in some of our examples).</p> <h3>FreeMarker</h3> <p>FreeMarker views can be written like any FreeMarker pages for @@ -66,8 +71,9 @@ documentation FreeMarker provides. Similarly to the JavaServer Pages definition above you will need to register the default view suffix accordingly for FreeMarker (typically <b>.ftl</b>).</p> -<p>You will need to register the <i>freemarker.ext.servlet.FreemarkerServlet</i> -in the <i>web.xml</i>:</p> +<p>You will need to register the <i>freemarker.ext.servlet.FreemarkerServlet</i> (or +<i>>com.opensymphony.module.sitemesh.freemarker.FreemarkerDecoratorServlet</i> if using in conjunction with +<a href="" in the <i>web.xml</i>:</p> <textarea class="xml:nogutter:nocontrols" name="code"> <servlet> <servlet-name>freemarker</servlet-name> @@ -78,31 +84,15 @@ <param-value>/</param-value> </init-param> <init-param> - <param-name>NoCache</param-name> - <param-value>true</param-value> + <param-name>object_wrapper</param-name> + <param-value>beans</param-value> </init-param> - <init-param> - <param-name>ContentType</param-name> - <param-value>text/html</param-value> - </init-param> - <!-- FreeMarker settings: --> - <init-param> - <param-name>template_update_delay</param-name> - <param-value>0</param-value> <!-- 0 is for development only! Use higher value otherwise. --> - </init-param> - <init-param> - <param-name>default_encoding</param-name> - <param-value>ISO-8859-1</param-value> - </init-param> - <init-param> - <param-name>number_format</param-name> - <param-value>0.##########</param-value> - </init-param> <load-on-startup>2</load-on-startup> </servlet> </textarea> <p>Again, see our working Freemarker example.</p> + <h3>Velocity</h3> <p>As with the JavaServer Pages and FreeMarker descriptions above you can access the actions from your Velocity script via the <b>action</b>
To unsubscribe from this list please visit:
