在gsp上,我有一個提交到控制器操作。在那個動作中,我想要做一些處理,然後從gsp傳遞post參數到另一個POST方法。我怎樣才能做到這一點?Grails安全插件:重定向文章並傳遞其數據
基本上,POST參數是否在呼叫重定向時專門處理?因爲我正在嘗試做以下事情。我有一些我想用來創建用戶帳戶的自定義gsp。
<form action='save' method='POST' id='createForm' class='cssform' autocomplete='off'>
<input type='text' class='text' name='j_username'/>
<input type='password' class='text' name='j_password'/>
<input type='submit' value='Create' />
</form>
我在我的控制器中有一個保存操作,我想在db上創建用戶,然後登錄。
def save = {
// creating user on DB
def config = SpringSecurityUtils.securityConfig
String postUrl = "${request.contextPath}${config.apf.filterProcesse sUrl}"
redirect(uri: postUrl, params: params)
}
重定向到j_security_check會導致登錄失敗。我懷疑這是由於重定向。
所以POST參數沒有經過特殊處理的? – soybie 2011-01-12 17:04:44