- Revision
- 301
- Author
- mward
- Date
- 2007-07-30 16:14:18 -0500 (Mon, 30 Jul 2007)
Log Message
update tutorials, content was out of date and causing confusion
Modified Paths
- trunk/distribution/src/site/content/tutorials/tutorial-one.html
- trunk/distribution/src/site/content/tutorials/tutorial-two.html
- trunk/distribution/src/site/templates/skin.html
Diff
Modified: trunk/distribution/src/site/content/tutorials/tutorial-one.html (300 => 301)
--- trunk/distribution/src/site/content/tutorials/tutorial-one.html 2007-07-29 17:20:18 UTC (rev 300) +++ trunk/distribution/src/site/content/tutorials/tutorial-one.html 2007-07-30 21:14:18 UTC (rev 301) @@ -75,65 +75,65 @@ <li><b>org.codehaus.waffle.registrar.Registrar</b> is the key used to register your applications custom Registrar. The key is the fully qualified name of the basic Registrar interface.</li> - <li><b>org.codehaus.waffle.context.WaffleContextListener</b> + <li><b>org.codehaus.waffle.context.pico.PicoWaffleContextListener</b> needs to be registered as a listener so that Waffle can be notified of context level (application, session) events.</li> - <li><b>org.codehaus.waffle.context.WaffleRequestFilter</b> this - is the Filter Waffle uses to handle request level events. This is - superior to a RequestAttributeListeners implementation because we can - ensure a request level container will only be created when appropriate - (i.e. not when images or cascading style sheets are requested).</li> - <li><b>org.codehaus.waffle.WaffleServlet</b> is Waffle's front - controller for handling requests. - <textarea class="xml:nogutter:nocontrols" name="code"> - <?xml version="1.0" encoding="UTF-8"?> - <web-app version="2.4" + <li> + <b>org.codehaus.waffle.context.WaffleRequestFilter</b> this is the Filter Waffle uses to handle request level + events. This is superior to a RequestAttributeListeners implementation because we can ensure a request level + container will only be created when appropriate (i.e. not when images or cascading style sheets are requested). + </li> + <li><b>org.codehaus.waffle.servlet.WaffleServlet</b> is Waffle's front controller for handling requests.</li> +</ol> + +<textarea class="xml:nogutter:nocontrols" name="code"> + <?xml version="1.0" encoding="UTF-8"?> + + <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee - http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> - <display-name>Waffle Tutorial Example</display-name> + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> - <!-- 1. This is how an application registers it custom Registrar --> + <display-name>Waffle Example</display-name> + + <!-- 1. This is how an application registers its custom Registrar --> <context-param> - <param-name>org.codehaus.waffle.registrar.Registrar</param-name> - <param-value>MyRegistrar</param-value> + <param-name>org.codehaus.waffle.registrar.Registrar</param-name> + <param-value>org.codehaus.waffle.example.MyRegistrar</param-value> </context-param> <!-- 2. Waffle context listener (ServletContext and HttpSession) --> <listener> - <listener-class>org.codehaus.waffle.context.WaffleContextListener</listener-class> + <listener-class>org.codehaus.waffle.context.pico.PicoWaffleContextListener</listener-class> </listener> <!-- 3. Waffle request filter (responsible for request level context) --> <filter> - <filter-name>WaffleRequestFilter</filter-name> - <filter-class>org.codehaus.waffle.context.WaffleRequestFilter</filter-class> + <filter-name>WaffleRequestFilter</filter-name> + <filter-class>org.codehaus.waffle.context.WaffleRequestFilter</filter-class> </filter> <filter-mapping> - <filter-name>WaffleRequestFilter</filter-name> - <url-pattern>*.waffle</url-pattern> + <filter-name>WaffleRequestFilter</filter-name> + <url-pattern>*.waffle</url-pattern> </filter-mapping> <!-- 4. Register Waffle's FrontController servlet --> <servlet> - <servlet-name>waffle</servlet-name> - <servlet-class>org.codehaus.waffle.servlet.WaffleServlet</servlet-class> - <init-param> - <param-name>view.suffix</param-name> - <param-value>.jsp</param-value> - </init-param> - <load-on-startup>1</load-on-startup> + <servlet-name>waffle</servlet-name> + <servlet-class>org.codehaus.waffle.servlet.WaffleServlet</servlet-class> + <init-param> + <param-name>view.suffix</param-name> + <param-value>.jspx</param-value> + </init-param> + <load-on-startup>1</load-on-startup> </servlet> - <servlet-mapping> - <servlet-name>waffle</servlet-name> - <url-pattern>*.Controller</url-pattern> + <servlet-name>waffle</servlet-name> + <url-pattern>*.waffle</url-pattern> </servlet-mapping> - </web-app> + </web-app> </textarea> - </li> -</ol> + <h3>View</h3> <p>We will create a very simple view to display the content of the Controller. The following example uses a JSP and simply displays the @@ -149,13 +149,13 @@ <tr> <td>Make: </td> <td> - <input type="text" value="<c:out value='${controller.make}'/>" name="make"/> + <input type="text" value="<c:out value='${make}'/>" name="make"/> </td> </tr> <tr> <td>Model: </td> <td> - <input type="text" value="<c:out value='${controller.model}'/>" name="model"/> + <input type="text" value="<c:out value='${model}'/>" name="model"/> </td> </tr> </table> @@ -179,7 +179,7 @@ +--- picocontainer.jar +--- waffle-1.x.jar +--- web.xml - +--- automobile.jsp + +--- automobile.jspx </textarea> <dl> <dt>NOTE</dt>
Modified: trunk/distribution/src/site/content/tutorials/tutorial-two.html (300 => 301)
--- trunk/distribution/src/site/content/tutorials/tutorial-two.html 2007-07-29 17:20:18 UTC (rev 300) +++ trunk/distribution/src/site/content/tutorials/tutorial-two.html 2007-07-30 21:14:18 UTC (rev 301) @@ -20,7 +20,7 @@ component. So each user will have their own instance of the autombile controller and, more importantly, the controller will live for the life of the users session.</p> -<div class="source"><pre> +<textarea class="java:nogutter:nocontrols" name="code"> // // Automobile.java // @@ -57,11 +57,11 @@ speed = 0; } } -</pre></div> +</textarea> <p>Next we will have to update the view to display the value of <i>speed</i> and also expose the two <i>ActionMethod</i> so they can be triggered by the users.</p> -<div class="source"><pre> +<textarea class="xml:nogutter:nocontrols" name="code"> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> @@ -71,19 +71,19 @@ <tr> <td>Make: </td> <td> - <input type="text" value="<c:out value='${controller.make}'/>" name="make"/> + <input type="text" value="<c:out value='${make}'/>" name="make"/> </td> </tr> <tr> <td>Model: </td> <td> - <input type="text" value="<c:out value='${controller.model}'/>" name="model"/> + <input type="text" value="<c:out value='${model}'/>" name="model"/> </td> </tr> <tr> <td>Speed: </td> <td> - <c:out value='${controller.speed}'/> + <c:out value='${speed}'/> </td> </tr> </table> @@ -95,7 +95,7 @@ <input type="submit"/> </form> </html> -</pre></div> +</textarea> <p>For this example we will concentrate on the more interesting of the two actions, <i>accelerate</i>. The accelerate action is defined as <b>automobile.waffle?method=accelerate|15</b>. Let's dissect this to get a better understanding of what is going on. @@ -166,7 +166,7 @@ the user's session under the name "dictionary". We can have that Map instance passed directly as an argument to the ActionMethod we want fired. Let's write a simple controller class as an example:</p> -<div class="source"><pre> +<textarea class="java:nogutter:nocontrols" name="code"> // // SampleAction.java // @@ -176,7 +176,7 @@ // do something with the dictionary ... } } -</pre></div> +</textarea> <p>This controller has one ActionMethod: <b>void myActionMethod(Map)</b>. Assume we have registered this controller under the name "sample". We can have Waffle fire this ActionMethod by
Modified: trunk/distribution/src/site/templates/skin.html (300 => 301)
--- trunk/distribution/src/site/templates/skin.html 2007-07-29 17:20:18 UTC (rev 300) +++ trunk/distribution/src/site/templates/skin.html 2007-07-30 21:14:18 UTC (rev 301) @@ -27,7 +27,7 @@ </div> <div id="breadcrumbs"> - <div class="left"> Last Published: July 28, 2007</div> + <div class="left"> Last Published: July 30, 2007</div> <div class="clear"></div> </div>
To unsubscribe from this list please visit:
