- Revision
- 912
- Author
- paul
- Date
- 2009-02-17 12:17:16 -0600 (Tue, 17 Feb 2009)
Log Message
fixup some language
Modified Paths
- sandbox/v2experiment/waffle-distribution/src/site/content/tutorials/tutorial-one.html
- sandbox/v2experiment/waffle-distribution/src/site/content/tutorials/tutorial-two.html
- sandbox/v2experiment/waffle-distribution/src/site/content/webxml.html
Diff
Modified: sandbox/v2experiment/waffle-distribution/src/site/content/tutorials/tutorial-one.html (911 => 912)
--- sandbox/v2experiment/waffle-distribution/src/site/content/tutorials/tutorial-one.html 2009-02-17 17:59:55 UTC (rev 911) +++ sandbox/v2experiment/waffle-distribution/src/site/content/tutorials/tutorial-one.html 2009-02-17 18:17:16 UTC (rev 912) @@ -44,27 +44,23 @@ } }</textarea> -<h3>Registrar</h3> +<h3>WebappComposer</h3> <p>As stated earlier, a Controller is not active in Waffle until it -has been registered with the Registrar. So now we will create a simple -Registrar class and register the <b>Automobile</b> class with it. The -MyRegistrar class below defines the method "<b>session</b>" -and within that method it calls <b>register("automobile", +has been registered with via a subclass of WaffleWebappComposer. So now we will create such a +class and register the <b>Automobile</b> class with it. The +MyComposer class below defines the method "<b>session</b>" +and within that method it calls <b>pico.addComponent("automobile", Automobile.class);</b>, which registers our Automobile class as an Controller under the name "automobile". Registration is not limited to Controllers because any component, service, factory, etc... can be registered. Detailed examples of this will be discussed later.</p> <textarea class="java:nogutter:nocontrols" name="code"> - public class MyRegistrar extends org.codehaus.waffle.registrar.AbstractRegistrar { + public class MyComposer extends WaffleWebappComposer { - public MyRegistrar(Registrar delegate) { - super(delegate); + public void composeSession(MutablePicoContainer pico) { + pico.addComponent("automobile", Automobile.class); } - - public void session() { - register("automobile", Automobile.class); - } }</textarea> <h3>web.xml</h3> @@ -72,17 +68,16 @@ files we still must create a <b>web.xml</b>. The web.xml example below has four points worth mentioning.</p> <ol type="1"> - <li><b><a href="" - org.codehaus.waffle.registrar.Registrar</a></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><a href="" - org.codehaus.waffle.context.pico.PicoWaffleContextListener</a></b> + <li><b><a href="" + webapp-composer-class</a></b> is the key + used to register your applications with Waffle.</li> + <li><b><a href="" + org.codehaus.waffle.servlet.WaffleListener</a></b> needs to be registered as a listener so that Waffle can be notified of context level (application, session) events.</li> <li> - <b><a href="" - org.codehaus.waffle.context.WaffleRequestFilter</a></b> this is the Filter Waffle uses to handle request level + <b><a href="" + org.codehaus.waffle.servlet.WaffleServlet$WaffleFilter</a></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> @@ -100,21 +95,21 @@ <display-name>Waffle Example</display-name> - <!-- 1. This is how an application registers its custom Registrar --> + <!-- 1. This is how an application registers its custom composer --> <context-param> - <param-name>org.codehaus.waffle.registrar.Registrar</param-name> - <param-value>org.codehaus.waffle.example.MyRegistrar</param-value> + <param-name>webapp-composer-class</param-name> + <param-value>org.codehaus.waffle.example.MyComposer</param-value> </context-param> <!-- 2. Waffle context listener (ServletContext and HttpSession) --> <listener> - <listener-class>org.codehaus.waffle.context.pico.PicoWaffleContextListener</listener-class> + <listener-class>org.codehaus.waffle.servlet.WaffleListener</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-class>org.codehaus.waffle.servlet.WaffleServlet$WaffleFilter</filter-class> </filter> <filter-mapping> <filter-name>WaffleRequestFilter</filter-name> @@ -173,9 +168,9 @@ might layout the code for this tutorial:</p> <textarea class="sql:nogutter:nocontrols" name="code"> +--- WEB-INF/ - +--- classes/ + +--- classes/org/codehaus/waffle/example +--- Automobile.class - +--- MyRegistrar.class + +--- MyComposer.class +--- lib/ +--- jstl.jar +--- standard.jar
Modified: sandbox/v2experiment/waffle-distribution/src/site/content/tutorials/tutorial-two.html (911 => 912)
--- sandbox/v2experiment/waffle-distribution/src/site/content/tutorials/tutorial-two.html 2009-02-17 17:59:55 UTC (rev 911) +++ sandbox/v2experiment/waffle-distribution/src/site/content/tutorials/tutorial-two.html 2009-02-17 18:17:16 UTC (rev 912) @@ -16,7 +16,7 @@ automobile. We add a <i>getter</i> for speed so we can make sure that the speed is in fact increasing. And we add two <b>action</b> methods: <b>void accelerate(String)</b> and <b>void stop()</b>. Remember we added the -"automobile" to the Registrar as a <i>Session-Level</i> +"automobile" to the WebappComposer as a <i>Session-Level</i> 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> @@ -106,7 +106,7 @@ <tr class="a"> <td align="left"><b>automobile</b></td> <td align="left">the Autombile.class controller was - registered under the name "automobile" in the Registrar, + registered under the name "automobile" in the WebappComposer, so this name maps to that <b>Controller</b></td> </tr> <tr class="b">
Modified: sandbox/v2experiment/waffle-distribution/src/site/content/webxml.html (911 => 912)
--- sandbox/v2experiment/waffle-distribution/src/site/content/webxml.html 2009-02-17 17:59:55 UTC (rev 911) +++ sandbox/v2experiment/waffle-distribution/src/site/content/webxml.html 2009-02-17 18:17:16 UTC (rev 912) @@ -7,7 +7,7 @@ <h2>web.xml</h2> <p>The <b>web.xml</b> below provides a base for you to build your -applications upon. Lines <b>11 - 14</b> declare which custom Registrar +applications upon. Lines <b>11 - 14</b> declare which custom WebappComposer should be used for your application. The <i>listener</i> registered on lines <b>17 - 19</b> is needed so that Waffle is alerted of application (ServletContext) and session life-cycle events and does not need changing. @@ -25,19 +25,19 @@ 09: 10: <!-- 1. This is how an application registers its custom Registrar --> 11: <context-param> -12: <param-name>org.codehaus.waffle.registrar.Registrar</param-name> -13: <param-value>org.codehaus.waffle.example.MyRegistrar</param-value> +12: <param-name>webapp-composer-class</param-name> +13: <param-value>org.codehaus.waffle.example.MyComposer</param-value> 14: </context-param> 15: 16: <!-- 2. Waffle context listener (ServletContext and HttpSession) --> 17: <listener> -18: <listener-class>org.codehaus.waffle.context.pico.PicoWaffleContextListener</listener-class> +18: <listener-class>org.codehaus.waffle.servlet.WaffleListener</listener-class> 19: </listener> 20: 21: <!-- 3. Waffle request filter (responsible for request level context) --> 22: <filter> 23: <filter-name>WaffleRequestFilter</filter-name> -24: <filter-class>org.codehaus.waffle.context.WaffleRequestFilter</filter-class> +24: <filter-class>org.codehaus.waffle.servlet.WaffleServlet$ServletFilter</filter-class> 25: </filter> 26: <filter-mapping> 27: <filter-name>WaffleRequestFilter</filter-name>
To unsubscribe from this list please visit:
