论坛首页 Java企业应用论坛

velocity问题,兄弟们帮忙啊

浏览 1065 次
该帖已经被评为隐藏帖
作者 正文
   发表时间:2007-11-12  
模板:
#foreach($cust in $customers)
      <tr>
        <td>
          <a href="dispalyCourse.htm?id={$cust.id}">
          ${cust.id}
          </a>
        </td>
        <td>$cust.name</td>
      </tr>
    #end
    </table>

错误提示:
08:43:32,156 WARN  [VelocityEngine] org.apache.velocity.runtime.exception.ReferenceException: reference : template = ticket/test.vm [line 28,column 11] : ${cust.id} is not a valid reference.
08:43:32,156 WARN  [VelocityEngine] org.apache.velocity.runtime.exception.ReferenceException: reference : template = ticket/test.vm [line 31,column 13] : $cust.name is not a valid reference.
DAO:
   public List selectCustomer(){
return getHibernateTemplate().find(" from  Customer");}
调用:
   public ModelAndView  testok(HttpServletRequest request, HttpServletResponse response)
{
Map model = new HashMap();

model.put("customers",this.getCustomerdao().selectCustomer());

return new ModelAndView("ticket/test",model);
}
为什么提示错误呢??  

论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics