67,513
社区成员
发帖
与我相关
我的任务
分享
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:form method="post" action="second">
<html:hidden property="o" value="doAdd" />
<table width="100%">
<tr>
<td>
<font color="#0000CC">您正在做的业务是:人力资源--客户化设置--人力资源档案管理设置--II级机构设置
</font>
</td>
</tr>
</table>
<table width="100%" border="1" cellpadding=0 cellspacing=1
class="input_table">
<tr>
<td width="19%" class="input_title">
I级机构名称
</td>
<td width="81%" class="input_content">
<!-- 从数据库中读取I级机构列表 -->
<html:select property="item.configFileFirstKind.firstKindId">
<html:optionsCollection name="FIRSTS_OPTIONS" label="firstKindName"
value="firstKindId" />
</html:select>
</td>
</tr>
<tr>
<td class="input_title">
II级机构名称
</td>
<td class="input_content">
<html:text property="item.secondKindName"/>
</td>
</tr>
<tr>
<td class="input_title">
薪酬发放责任人编号(多个编号之间请用"半角逗号"加"一个空格"隔开,如", ")
</td>
<td class="input_content">
<html:textarea property="item.secondSalaryId" rows="4"></html:textarea>
</td>
</tr>
<tr>
<td class="input_title">
销售责任人编号(多个编号之间请用"半角逗号"加"一个空格"隔开,如", ")
</td>
<td class="input_content"><html:textarea property="item.secondSaleId" rows="4"></html:textarea>
</td>
</tr>
</table>
<div class="button_bar">
<html:submit>保 存</html:submit>
<html:cancel>返 回</html:cancel>
</div>
<script>
build_validate("item.secondKindName","II级机构名不能为空","Limit","1","50");
</script>
</html:form>
public class SecondKindForm extends BaseForm {
ConfigFileSecondKind item = new ConfigFileSecondKind();
public ConfigFileSecondKind getItem() {
return item;
}
public void setItem(ConfigFileSecondKind item) {
this.item = item;
}
}
<bean name="/second" class="org.jb.y272.team0.web.action.SecondKindAction">
<property name="secondBiz">
<ref bean="secondBiz" />
</property>
<property name="firstBiz">
<ref bean="firstBiz" />
</property>
</bean>
public class SecondKindAction extends BaseAction {
private ConfigFileSecondKindBiz secondBiz ;
private ConfigFileFirstKindBiz firstBiz;
public ConfigFileSecondKindBiz getSecondBiz() {
return secondBiz;
}
public void setSecondBiz(ConfigFileSecondKindBiz secondBiz) {
this.secondBiz = secondBiz;
}
/**
* 跳转到新增页面
* @param mapping
* @param form
* @param request
* @param response
* @return
*/
public ActionForward toAdd(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
{
SecondKindForm myForm = (SecondKindForm)form;
//解决页面中item.configFileFirstKind.firstKindId中configFileFirstKind为NULL
ConfigFileSecondKind item = myForm.getItem();
if (null==item.getConfigFileFirstKind()){
item.setConfigFileFirstKind(new ConfigFileFirstKind());
}
myForm.setItem(item);
//查询出I级机构列表
List firsts = super.getFirsts(this.getServlet().getServletConfig().getServletContext(), this.firstBiz);
request.setAttribute("FIRSTS_OPTIONS", firsts);
return mapping.findForward("add");
}
/**
* 执行新增
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws IOException
*/
public ActionForward doAdd(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws IOException
{
SecondKindForm myForm = (SecondKindForm)form;
this.getSecondBiz().add(myForm.getItem());
response.sendRedirect("second.do?o=list");
return null;
}
/**
* 显示数据所有列表
* @param mapping
* @param form
* @param request
* @param messages
* @return
*/
public ActionForward list(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response)
{
SecondKindForm myForm = (SecondKindForm)form;
this.getSecondBiz().getList(myForm.getItem(), myForm.getPageResult());
return mapping.findForward("list");
}
public ConfigFileFirstKindBiz getFirstBiz() {
return firstBiz;
}
public void setFirstBiz(ConfigFileFirstKindBiz firstBiz) {
this.firstBiz = firstBiz;
}
private int secondKindId;
private String secondKindName;
private String secondSalaryId;
private String secondSaleId;
private ConfigFileFirstKind configFileFirstKind;
public ConfigFileFirstKind getConfigFileFirstKind() {
return configFileFirstKind;
}
public void setConfigFileFirstKind(ConfigFileFirstKind configFileFirstKind) {
this.configFileFirstKind = configFileFirstKind;
}
public int getSecondKindId() {
return secondKindId;
}
public void setSecondKindId(int secondKindId) {
this.secondKindId = secondKindId;
}
public String getSecondKindName() {
return secondKindName;
}
public void setSecondKindName(String secondKindName) {
this.secondKindName = secondKindName;
}
public String getSecondSalaryId() {
return secondSalaryId;
}
public void setSecondSalaryId(String secondSalaryId) {
this.secondSalaryId = secondSalaryId;
}
public String getSecondSaleId() {
return secondSaleId;
}
public void setSecondSaleId(String secondSaleId) {
this.secondSaleId = secondSaleId;
}
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<filter>
<filter-name>SetCharacterEncodingFilter</filter-name>
<filter-class>org.jb.common.filter.SetCharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>GBK</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>SetCharacterEncodingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>SetCharacterEncodingFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet>
<servlet-name>action_tmp</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
</web-app>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<form-beans>
<form-bean name="userForm" type="org.jb.y272.team0.web.form.UserForm" />
<form-bean name="roleForm" type="org.jb.y272.team0.web.form.RoleForm" />
<form-bean name="rightForm" type="org.jb.y272.team0.web.form.RightForm" />
<form-bean name="firstKindForm" type="org.jb.y272.team0.web.form.FirstKindForm" />
<form-bean name="secondKindForm" type="org.jb.y272.team0.web.form.SecondKindForm" />
<form-bean name="baseForm" type="org.jb.common.web.form.BaseForm" />
</form-beans>
<action-mappings>
<action path="/home" parameter="o" scope="session"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="header" path="/WEB-INF/jsp/home/header.jsp" />
<forward name="footer" path="/WEB-INF/jsp/home/footer.jsp" />
<forward name="menu" path="/WEB-INF/jsp/home/menu.jsp" />
<forward name="welcome" path="/WEB-INF/jsp/home/welcome.jsp" />
</action>
<action name="userForm" path="/user" parameter="o"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="list" path="/WEB-INF/jsp/user/list.jsp" />
<forward name="add" path="/WEB-INF/jsp/user/add.jsp" />
<forward name="edit" path="/WEB-INF/jsp/user/edit.jsp" />
<forward name="detail" path="/WEB-INF/jsp/user/detail.jsp" />
<forward name="assign_role"
path="/WEB-INF/jsp/user/assign_role.jsp" />
</action>
<action name="roleForm" path="/role" parameter="o"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="add" path="/WEB-INF/jsp/role/add.jsp" />
<forward name="edit" path="/WEB-INF/jsp/role/edit.jsp" />
<forward name="list" path="/WEB-INF/jsp/role/list.jsp" />
<forward name="assign_rights"
path="/WEB-INF/jsp/role/assign_rights.jsp" />
</action>
<action attribute="rightForm"
name="rightForm" parameter="o" path="/right" scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="add" path="/WEB-INF/jsp/rights/add.jsp" />
<forward name="edit" path="/WEB-INF/jsp/rights/edit.jsp" />
<forward name="list" path="/WEB-INF/jsp/rights/list.jsp" />
</action>
<action input="/WEB-INF/jsp/home/top.jsp" name="baseForm"
path="/main" scope="request"
type="org.springframework.web.struts.DelegatingActionProxy"
validate="false">
<forward name="top" path="/WEB-INF/jsp/main/index_top.html" />
<forward name="left"
path="/WEB-INF/jsp/main/index_left.jsp" />
<forward name="right"
path="/WEB-INF/jsp/main/index_right.htm" />
<forward name="bottom"
path="/WEB-INF/jsp/main/index_bottom.jsp" />
</action>
<action name="firstKindForm" path="/first" parameter="o"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="list" path="/WEB-INF/jsp/config/file/first_kind.jsp" />
<forward name="add" path="/WEB-INF/jsp/config/file/first_kind_register.jsp" />
</action>
<action name="secondKindForm" path="/second" parameter="o"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="list" path="/WEB-INF/jsp/config/file/second_kind.jsp" />
<forward name="add" path="/WEB-INF/jsp/config/file/second_kind_register.jsp" />
</action>
</action-mappings>
<message-resources
parameter="org.jb.y272.team0.ApplicationResources" />
<plug-in
className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="classpath:applicationContext.xml" />
</plug-in>
</struts-config>