+ -
当前位置:首页 → 问答吧 → html:select(html:optioin)值绑定问题.各位高手帮帮忙

html:select(html:optioin)值绑定问题.各位高手帮帮忙

时间:2011-09-08

来源:互联网

不知道为什么,页面不走action出来的是空的select下拉列表框,他的值我是从数据库中读出来的,可是就是绑定不上去。
<html:form action="/epets" method="post">
  <html:hidden property="operate" value="toList"/>
  <html:select property="user.id">
  <html:optionsCollection property="qxList" label="name" value="id" />
  </html:select>
</html:form>
这是我的页面代码。
public ActionForward toList(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
EpetsForm epetsForm = (EpetsForm) form;
List list=biz.userAdders();
epetsForm.setQxList(list);
request.setAttribute("qxList",epetsForm.getQxList());
return mapping.findForward("regsiter");
}
这是action代码。
public class EpetsForm extends ActionForm {

private List qxList = new ArrayList();
public User user=new User();
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// TODO Auto-generated method stub
return null;
}

public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}

public User getUser() {
return user;
}

public void setUser(User user) {
this.user = user;
}

public List getQxList() {
return qxList;
}

public void setQxList(List qxList) {
this.qxList = qxList;
}

}
这是form代码。
<struts-config>
  <data-sources />
  <form-beans >
   
  <form-bean name="epetsForm" type="com.aptech.jb.epet.web.form.EpetsForm" />

  </form-beans>

  <global-exceptions />
  <global-forwards />
  <action-mappings >
  <action
  attribute="epetsForm"
  input="/regsiter.jsp"
  name="epetsForm"
  path="/epets"
  scope="request"
  type="com.aptech.jb.epet.web.action.EpetsAction" parameter="operate">
  <forward name="regsiter" path="/regsiter.jsp" />
  </action>
   
   
   

  </action-mappings>

  <message-resources parameter="com.apetech.jb.epet.ApplicationResources" />
</struts-config>
这是配置文件

作者: wins1   发布时间: 2011-09-08

有什么错误信息吗

调试一下

作者: wangquanzheng   发布时间: 2011-09-08

根本就不进action,也没有什么错误信息,郁闷啊!

作者: wins1   发布时间: 2011-09-08