java.lang.IllegalArgumentException: No bean specified

javax.servlet.ServletException: BeanUtils.populate org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495) org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:816) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) javax.servlet.http.HttpServlet.service(HttpServlet.java:710) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.jb.common.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:32) root cause java.lang.IllegalArgumentException: No bean specified org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java:837) org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:934) org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808) org.apache.struts.util.RequestUtils.populate(RequestUtils.java:493) org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:816) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) javax.servlet.http.HttpServlet.service(HttpServlet.java:710) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.jb.common.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:32)

<

html:select
property
="a.Bean"
>


private Bean bean;

public Bean getBean() {

return

bean
;

}

public void setBean(Bean

bean
) {

this.bean =

bean
;

}




出现异常的原因


bean
没有初始化

解决方法new 一下就行了

private Bean bean = new Bean();





你可能感兴趣的:(html,bean)