Created
February 25, 2013 22:20
-
-
Save koji-k/5033873 to your computer and use it in GitHub Desktop.
Grails2.2でg:eachとg:createLinkの組み合わせにおけるバグ?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ビューでの処理 | |
// 渡されたMapを元にリンクを生成 | |
// このロジックを以下の「成功するパターン」と「失敗するパターン」で同様に実行する | |
<g:each in="${debug}" status="i" var="record"> | |
<g:createLink controller='hello' action='debug' params='[p:"${record.key}"]' /><br /> | |
</g:each> | |
//------------------------------ | |
// 成功するパターン | |
//------------------------------ | |
// コントローラからビューに渡すMap | |
def debug = ["a": 1, "b":2, "c":3] | |
// ビューの実行結果(出力) | |
/HelloGrails/hello/debug?p=a | |
/HelloGrails/hello/debug?p=b | |
/HelloGrails/hello/debug?p=c | |
//------------------------------ | |
// 失敗するパターン | |
//------------------------------ | |
// コントローラからビューに渡すMap | |
def debug = ["Unknown": 1, "groovy":2, "Groovy":3, "unknown":4] | |
// ビューの実行結果(出力) | |
/HelloGrails/hello/debug?p=Unknown | |
/HelloGrails/hello/debug?p=groovy | |
/HelloGrails/hello/debug | |
/HelloGrails/hello/debug |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment