struts中html:options的问题
我的框架采用strtus+spring,在用html:options时出现 Cannot find bean under name custList 错误
具体代码如下:
--------------------------left.jsp--------------------------
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<body>
<html:form action="/left">
客户名称: <html:select property="customer">
<html:options collection="custList" property="CustId"
labelProperty="CustName" />
</html:select>
</html:form>
</body>
</html>
--------------------------leftForm--------------------------
public class LeftForm extends ActionForm
{
private String customer;
private String custList;
public String getCustomer()
{
return customer;
}
public void setCustomer(String customer)
{
this.customer = customer;
}
public String getCustList()
{
return custList;
}
public void setCustList(String custList)
{
this.custList = custList;
}
}
--------------------------leftAction--------------------------
public class LeftAction extends Action
{
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
{
LeftForm leftForm = (LeftForm) form;
Vector rs = new Vector(2);
rs.add(new LabelValueBean("CSDN", "001"));
rs.add(new LabelValueBean("百度", "002"));
request.setAttribute("custList", rs);
return (new ActionForward(mapping.getInput()));
}
}
--------------------------struts-config.xml--------------------------
<form-beans>
<form-bean name="leftForm" type="com.test.struts.form.LeftForm" />
</form-beans>
<action-mappings>
<action attribute="leftForm" input="/left.jsp" name="leftForm"
path="/left" scope="request"
type="org.springframework.web.struts.DelegatingActionProxy" />
</action-mappings>
<message-resources parameter="com.test.struts.ApplicationResources" />
<plug-in
className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/applicationContext.xml" />
</plug-in>
--------------------------applicationContext.xml-------------------------
<bean name="/left" class="com.test.struts.action.LeftAction"></bean>
有谁知道问题出在什么地方?