日期:2014-05-18  浏览次数:20802 次

struts页面的错误no getter method for property
action代码:
private   ActionForward   display(ActionMapping   mapping,   ActionForm   form,
HttpServletRequest   request,   HttpServletResponse   response)   {
//   TODO   自动生成方法存根
ArrayList   arraylist   =   new   ArrayList();
ArrayList   array   =   new   ArrayList();
//   stub
String   sid   =   request.getParameter( "sid ");
/*
  *   将板块名称单独取出来
  */
op.setSname(form,   request,   sid);

HttpSession   session   =   request.getSession();

arraylist   =   lr
.executeQuery( "select   t.TNumber,s.SName,u.UName,t.TTopic,t.TTime,t.TClickCount,t.TId   from   bbstopic   as   t   inner   join   bbssection   as   s   on   t.TSid   =   s.SId   inner   join   bbsuser   as   u   on   t.TUid   =   u.UId   where   t.TSid= "
+   sid);

  for   (int   j   =   0;   j   <   arraylist.size();   j++)   {
 
    //   在此每个array都表示一条纪录
 
  array   =   (ArrayList)   arraylist.get(j);
  tf   =   new   TopicForm();
  for   (int   i   =   0;   i   <   array.size();   i++)   {
  tf.setTnumber(array.get(0).toString());
  tf.setTsname(array.get(1).toString());
  tf.setTuname(array.get(2).toString());
  tf.setTtopic(array.get(3).toString());
  tf.setTtime(array.get(4).toString());
  tf.setTclickcount(array.get(5).toString());
  tf.setTid(array.get(6).toString());
  System.out.println(array.get(i));  
  }
  array.add(tf);
  }
if   (array   !=   null)   {
session.setAttribute( "topics ",array);
return   mapping.findForward( "showtopic ");
}   else   {
/*
  *   如果查询的板块没有帖子
  */
return   mapping.findForward( "fail ");
}
}
页面代码:
<logic:present   name= "topics "   scope= "session ">
    <logic:iterate   id= "topic "   name= "topics ">
    <tr>
    <td> <bean:write   property= "tnumber "   name= "topic "/> </td>
    <td> <a   href= "/BBS/topic.do?method=lookup&tnumber= <bean:write   property= "tnumber "   name= "topic "/> &tid= <bean:write   property= "tid "   name= "topic "/> "> <bean:write   property= "ttopic "   name= "topic "/> </a> </td>
    <td> <bean:write   property= "tuname "   name= "topic "/> </td>
    <td> <bean:write   property= "ttime "   name= "topic "/> </td>
    <td> <bean:write   property= "tclickcount "   name= "topic "/> </td>
    </tr>