【发布时间】:2011-09-02 23:02:46
【问题描述】:
我的控制器如下:
def participated = {
def temp = ConferenceUser.get(params.temp)
def prizes = Prizes.findAllByConferenceUser(temp) // find all rooms where current computer is
def subms = Submissions.findAllByConferenceUser(temp) // find all rooms where current computer is
[temp: temp, priz: prizes, subm: subms]
}
但不知何故,当我成功更新会议值时,我想回到初始页面(参与)但我不知道如何传回params.temp。 (如果我做一个简单的重定向,因为控制器期望 params.temp,它会给我一个错误,因为我无法使用空对象作为参数搜索奖品。所以,想象我的更新控制器如下:
def update = {
def saveParamshere = params.temp
...
...
(code here)
...
...
redirect(action: "participated", params: [temp: saveParamshere])
}
此代码无效。怎样才能成功回到我的主页并传入params.temp?
【问题讨论】:
标签: grails params controllers