【发布时间】:2012-07-25 08:10:23
【问题描述】:
我有一个名为 Student 的域类。它包含一些变量,例如 student_name,student_address,student_class。实际上我想按 student_class 的顺序显示学生详细信息。
我有一个名为 list.gsp 的 GSP 页面。 list.gsp:
<g:each in="${std}" status="v" var="stdInstance"> //All Class eg:1..10.
<h3>${stdInstance.std_class}</h3>
//Innerloop
//here i want to display students details depending on the value of stdInstance.std_class.
</g:each>
我想知道如何通过内部 g:each 调用控制器动作并传递参数。
【问题讨论】:
-
变量 std 是对象的“列表”吗?你是说你需要遍历这个列表并根据每个“stdInstance.std_class”中的值你需要做些什么吗?