struts2 <s:select>标签错误信息

action:

public class StudentAction extends ActionSupport {

 /**
  *
  */
 private static final long serialVersionUID = -4514107777773878982L;

 public List <Student> departments;
 public List<Student> getDepartments() {
  return this.departments;
 }
 public List<Student> getAllDepartments() {
  
  return null;
  
 }

 public void setDepartments(List<Student> departments) {
  this.departments = departments;
 }
}

struts.xml

<action name="studentAction" class="jp.panitec.action.StudentAction" method="getAllDepartments"/>

applicationContext.xml

<bean id="studentAction"
       class="jp.panitec.action.StudentAction">
 <property name="studentManager">
    <ref local="studentManager"/>
 </property>
 </bean>

jsp

<td>性別</td>
      <td>
      <s:select list="#StudentAction.departments" name="gender"
      value="gender" listKey="emp_id" listValue="name"></s:select>
      </td>

student 表中部分字段:

public class Student implements Serializable {

    /**
  *
  */
 private static final long serialVersionUID = 5005917481973631062L;
    private jp.panitec.model.StudentPK comp_id;
    private byte[] photo;
    private String name;
    private String gender;

}

 

错误信息

2008/05/29 17:43:01 org.apache.catalina.core.StandardWrapperValve invoke
致命的: サーブレット jsp のServlet.service()が例外を投げました
tag 'select', field 'list', name 'gender': The requested list key '#StudentAction.departments' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]
 at org.apache.struts2.components.Component.fieldError(Component.java:231)

如何修改 给个好的建议吧

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值