- Revision
- 891
- Author
- paul
- Date
- 2009-01-15 18:13:59 -0600 (Thu, 15 Jan 2009)
Log Message
mydvd example half working
Modified Paths
- sandbox/v2experiment/examples/jruby-example/src/main/webapp/WEB-INF/web.xml
- sandbox/v2experiment/examples/mydvds-example/src/main/java/org/codehaus/waffle/example/mydvds/MyDvdsWebappComposer.java
- sandbox/v2experiment/examples/mydvds-example/src/main/webapp/WEB-INF/web.xml
Added Paths
Diff
Modified: sandbox/v2experiment/examples/jruby-example/src/main/webapp/WEB-INF/web.xml (890 => 891)
--- sandbox/v2experiment/examples/jruby-example/src/main/webapp/WEB-INF/web.xml 2009-01-15 23:25:56 UTC (rev 890) +++ sandbox/v2experiment/examples/jruby-example/src/main/webapp/WEB-INF/web.xml 2009-01-16 00:13:59 UTC (rev 891) @@ -10,7 +10,7 @@ <!-- 1. This is how an application registers its custom Registrar --> <context-param> <param-name>org.codehaus.waffle.registrar.Registrar</param-name> - <param-value>org.codehaus.waffle.example.jruby.JRubyRegistrar</param-value> + <param-value>org.codehaus.waffle.example.jruby.JrubyExampleWebappComposer</param-value> </context-param> <context-param> <param-name>org.codehaus.waffle.monitor.RegistrarMonitor</param-name> @@ -33,15 +33,15 @@ <!-- Ruby Specific components --> <context-param> <param-name>org.codehaus.waffle.context.ContextContainerFactory</param-name> - <param-value>org.codehaus.waffle.ruby.context.RubyContextContainerFactory</param-value> + <param-value>org.codehaus.waffle.context.pico.RubyPicoContextContainerFactory</param-value> </context-param> <context-param> <param-name>org.codehaus.waffle.bind.ControllerDataBinder</param-name> - <param-value>org.codehaus.waffle.ruby.bind.ognl.RubyControllerDataBinder</param-value> + <param-value>org.codehaus.waffle.bind.ognl.RubyControllerDataBinder</param-value> </context-param> <context-param> <param-name>org.codehaus.waffle.controller.ControllerDefinitionFactory</param-name> - <param-value>org.codehaus.waffle.ruby.controller.RubyControllerDefinitionFactory</param-value> + <param-value>org.codehaus.waffle.controller.RubyControllerDefinitionFactory</param-value> </context-param> <!-- OPTIONAL: define a path to the ruby script directory (for development) @@ -57,7 +57,7 @@ </context-param>--> <listener> - <listener-class>org.codehaus.waffle.context.WaffleContextListener</listener-class> + <listener-class>org.codehaus.waffle.context.pico.PicoWaffleContextListener</listener-class> </listener> <!-- 4. Waffle request filter (responsible for request level context) --> @@ -82,7 +82,7 @@ </servlet> <servlet> <servlet-name>rhtml</servlet-name> - <servlet-class>org.codehaus.waffle.ruby.servlet.RhtmlServlet</servlet-class> + <servlet-class>org.codehaus.waffle.servlet.RhtmlServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet>
Modified: sandbox/v2experiment/examples/mydvds-example/src/main/java/org/codehaus/waffle/example/mydvds/MyDvdsWebappComposer.java (890 => 891)
--- sandbox/v2experiment/examples/mydvds-example/src/main/java/org/codehaus/waffle/example/mydvds/MyDvdsWebappComposer.java 2009-01-15 23:25:56 UTC (rev 890) +++ sandbox/v2experiment/examples/mydvds-example/src/main/java/org/codehaus/waffle/example/mydvds/MyDvdsWebappComposer.java 2009-01-16 00:13:59 UTC (rev 891) @@ -14,6 +14,7 @@ public class MyDvdsWebappComposer extends WaffleWebappComposer { + @Override public void composeApplication(MutablePicoContainer picoContainer, ServletContext servletContext) { super.composeApplication(picoContainer, servletContext);
Modified: sandbox/v2experiment/examples/mydvds-example/src/main/webapp/WEB-INF/web.xml (890 => 891)
--- sandbox/v2experiment/examples/mydvds-example/src/main/webapp/WEB-INF/web.xml 2009-01-15 23:25:56 UTC (rev 890) +++ sandbox/v2experiment/examples/mydvds-example/src/main/webapp/WEB-INF/web.xml 2009-01-16 00:13:59 UTC (rev 891) @@ -5,50 +5,50 @@ 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 Example</display-name> + <display-name>Waffle MyDVD Example</display-name> - <context-param> - <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> - <param-value>ApplicationResources</param-value> - </context-param> + <context-param> + <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> + <param-value>ApplicationResources</param-value> + </context-param> - <!-- 1. This is how an application registers its custom Registrar --> - <context-param> - <param-name>org.codehaus.waffle.registrar.Registrar</param-name> - <param-value>org.codehaus.waffle.example.mydvds.MyDvdsRegistrar</param-value> - </context-param> + <!-- 1. This is how PicoContainer-Web registers composition class --> + <context-param> + <param-name>webapp-composer-class</param-name> + <param-value>org.codehaus.waffle.example.mydvds.MyDvdsWebappComposer</param-value> + </context-param> - <!-- 3. Waffle context listener (ServletContext and HttpSession) --> - <listener> - <listener-class>org.codehaus.waffle.context.WaffleContextListener</listener-class> - </listener> + <!-- 3. PicoContainer-Web context listener (ServletContext and HttpSession) --> + <listener> + <listener-class>org.codehaus.waffle.servlet.WaffleListener</listener-class> + </listener> - <!-- 4. Waffle request filter (responsible for request level context) --> - <filter> - <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-mapping> + <!-- 4. Waffle request filter (responsible for request level context) --> + <filter> + <filter-name>WaffleRequestFilter</filter-name> + <filter-class>org.codehaus.waffle.servlet.WaffleServlet$ServletFilter</filter-class> + </filter> + <filter-mapping> + <filter-name>WaffleRequestFilter</filter-name> + <url-pattern>*.waffle</url-pattern> + </filter-mapping> - <!-- 5. 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>.jspx</param-value> - </init-param> - <load-on-startup>1</load-on-startup> - </servlet> - <servlet-mapping> - <servlet-name>waffle</servlet-name> - <url-pattern>*.waffle</url-pattern> - </servlet-mapping> + <!-- 5. 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>.jspx</param-value> + </init-param> + <load-on-startup>1</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>waffle</servlet-name> + <url-pattern>*.waffle</url-pattern> + </servlet-mapping> - <welcome-file-list> - <welcome-file>index.jspx</welcome-file> - </welcome-file-list> + <welcome-file-list> + <welcome-file>index.jspx</welcome-file> + </welcome-file-list> </web-app>
Added: sandbox/v2experiment/waffle-core/src/main/java/org/codehaus/waffle/servlet/WaffleListener.java (0 => 891)
--- sandbox/v2experiment/waffle-core/src/main/java/org/codehaus/waffle/servlet/WaffleListener.java (rev 0) +++ sandbox/v2experiment/waffle-core/src/main/java/org/codehaus/waffle/servlet/WaffleListener.java 2009-01-16 00:13:59 UTC (rev 891) @@ -0,0 +1,29 @@ +package org.codehaus.waffle.servlet; + +import org.picocontainer.web.PicoServletContainerListener; +import org.picocontainer.DefaultPicoContainer; +import org.picocontainer.ComponentMonitor; +import org.picocontainer.LifecycleStrategy; +import org.picocontainer.monitors.NullComponentMonitor; +import org.picocontainer.behaviors.Guarding; +import org.picocontainer.behaviors.Caching; +import org.picocontainer.behaviors.Storing; +import org.codehaus.waffle.context.pico.WaffleLifecycleStrategy; + +public class WaffleListener extends PicoServletContainerListener { + + protected ScopedContainers makeScopedContainers() { + DefaultPicoContainer appCtnr = new DefaultPicoContainer(new Guarding().wrap(new Caching()), makeLifecycleStrategy(), makeParentContainer()); + Storing sessStoring = new Storing(); + DefaultPicoContainer sessCtnr = new DefaultPicoContainer(new Guarding().wrap(sessStoring), makeLifecycleStrategy(), appCtnr); + Storing reqStoring = new Storing(); + DefaultPicoContainer reqCtnr = new DefaultPicoContainer(new Guarding().wrap(addRequestBehaviors(reqStoring)), makeLifecycleStrategy(), sessCtnr); + return new ScopedContainers(appCtnr, sessCtnr, reqCtnr, sessStoring, reqStoring); + } + + protected LifecycleStrategy makeLifecycleStrategy() { + return new WaffleLifecycleStrategy(makeComponentMonitor()); + } + + +}
To unsubscribe from this list please visit:
