- Revision
- 136
- Author
- mward
- Date
- 2007-06-03 13:47:34 -0500 (Sun, 03 Jun 2007)
Log Message
simple example of calling a standard waffle view (jsp) from a ruby controller
Modified Paths
- trunk/core/core.iml
- trunk/core/src/test/java/org/codehaus/waffle/bind/IntrospectingRequestAttributeBinderTest.java
- trunk/examples/jruby-example/src/main/ruby/ruby/foo_bar.rb
Added Paths
Diff
Modified: trunk/core/core.iml (135 => 136)
--- trunk/core/core.iml 2007-06-03 09:21:02 UTC (rev 135) +++ trunk/core/core.iml 2007-06-03 18:47:34 UTC (rev 136) @@ -135,18 +135,16 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="" /> + <root url="" /> </CLASSES> <JAVADOC /> - <SOURCES> - <root url="" /> - </SOURCES> + <SOURCES /> </library> </orderEntry> <orderEntry type="module-library"> <library> <CLASSES> - <root url="" /> + <root url="" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -155,10 +153,12 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="" /> + <root url="" /> </CLASSES> <JAVADOC /> - <SOURCES /> + <SOURCES> + <root url="" /> + </SOURCES> </library> </orderEntry> <orderEntryProperties />
Modified: trunk/core/src/test/java/org/codehaus/waffle/bind/IntrospectingRequestAttributeBinderTest.java (135 => 136)
--- trunk/core/src/test/java/org/codehaus/waffle/bind/IntrospectingRequestAttributeBinderTest.java 2007-06-03 09:21:02 UTC (rev 135) +++ trunk/core/src/test/java/org/codehaus/waffle/bind/IntrospectingRequestAttributeBinderTest.java 2007-06-03 18:47:34 UTC (rev 136) @@ -1,14 +1,14 @@ package org.codehaus.waffle.bind; +import org.codehaus.waffle.controller.RubyController; import org.jmock.Expectations; import org.jmock.Mockery; import org.jmock.integration.junit4.JMock; import org.jmock.integration.junit4.JUnit4Mockery; +import org.jruby.Ruby; +import org.jruby.runtime.builtin.IRubyObject; import org.junit.Test; import org.junit.runner.RunWith; -import org.codehaus.waffle.controller.RubyController; -import org.jruby.Ruby; -import org.jruby.runtime.builtin.IRubyObject; import javax.servlet.http.HttpServletRequest;
Added: trunk/examples/jruby-example/resources/foobar.jspx (0 => 136)
--- trunk/examples/jruby-example/resources/foobar.jspx (rev 0) +++ trunk/examples/jruby-example/resources/foobar.jspx 2007-06-03 18:47:34 UTC (rev 136) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<html xmlns="http://www.w3.org/1999/xhtml" + xmlns:jsp="http://java.sun.com/JSP/Page" + xmlns:waffle="http://thoughtworks.com/java/waffle" + xmlns:fn="http://java.sun.com/jsp/jstl/functions" + xmlns:c="http://java.sun.com/jsp/jstl/core"> + +<jsp:output doctype-root-element="html" + doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" + doctype-system="http://www.w3c.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/> +<jsp:directive.page contentType="text/html;charset=UTF-8"/> + +<head> + <title>From Ruby Script</title> +</head> + +<body> +<h2>Waffle and JRuby ${var1}</h2> + + +</body> + +</html> \ No newline at end of file
Modified: trunk/examples/jruby-example/src/main/ruby/ruby/foo_bar.rb (135 => 136)
--- trunk/examples/jruby-example/src/main/ruby/ruby/foo_bar.rb 2007-06-03 09:21:02 UTC (rev 135) +++ trunk/examples/jruby-example/src/main/ruby/ruby/foo_bar.rb 2007-06-03 18:47:34 UTC (rev 136) @@ -1,4 +1,7 @@ +include_class 'org.codehaus.waffle.view.View' + class FooBar + def index request[:foo] = 'bar' session[:bar] = 'foo' @@ -22,4 +25,9 @@ "HELLO WORLD #{request.local_name} #{request.local_port}" end + def jspx + @var1 = "this is my variables value from jruby" + return View.new("foobar.jspx", self) + end + end \ No newline at end of file
To unsubscribe from this list please visit:
