我的源码
action文件
public class peisongAction extends ActionSupport{
public String execute() {
PeiSongJinDuBean peisongBean = new PeiSongJinDuBean();
PeiSongJinDuBean peisong1 = new PeiSongJinDuBean();
peisongBean.setOrder_id("Porder_id");
// Porder_id=ServletActionContext.getRequest().getParameter("Porder_id");//获取前端页面传递参数
try {
peisong1 = (PeiSongJinDuBean) peisongDao.SelectPeiSongJinDuInfo(peisongBean);
worder_id = peisong1.getOrder_id();
wproduct_pic_address = peisong1.getProduct_pic_address();
wprice = peisong1.getPrice();
wnumber = peisong1.getNumber();
worder_status = peisong1.getOrder_status();
System.out.println(worder_id+wproduct_pic_address+wprice+wnumber+worder_status);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return SUCCESS;
}
Dao文件
public class SelectPeiSongJinDuDao extends SqlMapClientDaoSupport{
public Object SelectPeiSongJinDuInfo(PeiSongJinDuBean peisongBean) throws SQLException{
return getSqlMapClientTemplate().queryForObject("selectPeiSongJinDuInfo",peisongBean);
}
}
struts.xml配置文件
<package name="Delivery_Schedule" extends="struts-default" >
<action name="peisongAction"
class="com.wx.action.peisong.peisongAction">
<result name="success">
/WEB-INF/pages/Delivery_Schedule/PeiSongJinDu.jsp
</result>
</action>
</package>
ApplicationSystem.xml文件
<bean id="SelectPeiSongJinDuDao" class="com.wx.dao.persisten.SelectPeiSongJinDuDao">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="sqlMapClient">
<ref local="sqlMapClient" />
</property>
</bean>
<!-- 查询配送状态 -->
<bean id="peisongDao" class="com.wx.action.peisong.peisongAction">
<property name="peisongDao">
<ref local="SelectPeiSongJinDuDao" />
</property>
</bean>
bean的SQL配置文件
<select id="selectPeiSongJinDuInfo" parameterClass="peisongBean"
resultClass="peisongBean">
SELECT
order_id,product_pic_address,price,number,order_status FROM
XQ_ORDER_INFO_TAB WHERE order_id=#order_id#
</select>
请各位 帮我看一下 为什么总是在 前端页面 提交表单时出现错误
错误为:Exception occurred during processing request: Unable to instantiate Action, com.wx.action.peisong.peisongAction, defined for 'peisongAction' in namespace ''Error creating bean with name 'com.wx.action.peisong.peisongAction' defined in null: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.wx.action.peisong.peisongAction] to required type [com.wx.dao.persisten.SelectPeiSongJinDuDao] for property 'peisongDao']
Unable to instantiate Action, com.wx.action.peisong.peisongAction, defined for 'peisongAction' in namespace ''Error creating bean with name 'com.wx.action.peisong.peisongAction' defined in null: Error setting property values; nested exception is org.springframework.beans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [com.wx.action.peisong.peisongAction] to required type [com.wx.dao.persisten.SelectPeiSongJinDuDao] for property 'peisongDao']
我只有25分了 全拿出来了 帮帮忙 谢谢 之前我也问过 都没有回答正确的 分全没了 谢谢各位了
------解决方案--------------------
<!-- 查询配送状态 -->
<bean id="peisongDao" class="com.wx.action.peisong.peisongAction">
<property name="peisongDao">
<ref local="SelectPeiSongJinDuDao" />
</property>
</bean>
这个地方明显有问题吧?
bean的ID叫peisongDao,而class却是个Action,检查一下是不是笔误了?