我创建了一个名为ShopController
的新控制器,用于Webflows。这是代码:浏览器不呈现在Grails Webflows中的视图文件
class ShopController {
def index() {
redirect(action:"order")
}
def orderFlow = {
display {
on("next") {
}.to("finish")
}
finish {
redirect(controller:"user", action:"index")
}
}
}
而在views/shop/order/display
我创造了这样一个文件:
<html>
<head>
<title>Testing</title>
</head>
<body>
<h1>Testing</h1>
Testing webflows.
<g:form action="order">
</g:form>
</body>
</html>
然而高达这个看起来简单,当我跑我的Grails应用程序,将浏览器指向http://localhost:8080/testing/shop/order/display
我没有得到什么。没有任何意义,没有来自Apache的错误消息,没有文字,我只看到一个空白屏幕。
我正在使用Grails 2.0
我哪里出错了?我犯了什么愚蠢的错误?
在此先感谢。在
}.to("finsh")
那不是错误!我甚至尝试在第9章的动作示例中运行Grails .. https://github.com/pledbrook/graina/tree/master/source-code/ch09/hubbub/grails-app/controllers/com/grailsinaction。这有ShopController作为webflow。即使这与我的问题显示相同的东西... – 2011-12-31 09:19:05