首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

关于ssh框架文件映射的有关问题

2012-09-20 
关于ssh框架文件映射的问题文件applicationContext.xml中部分设置valuecom/xjgl/hibernate/beans/Cx.hbm

关于ssh框架文件映射的问题
文件applicationContext.xml中部分设置
<value>
  com/xjgl/hibernate/beans/Cx.hbm.xml
</value>
.................................
<bean id="CxDAO" class="com.xjgl.hibernate.beans.CxDAO">
  <property name="sessionFactory">
  <ref local="sessionFactory" />
  </property>
</bean>
....................................
<bean id="CxDAOProxy"
  class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
  <property name="transactionManager">
  <ref bean="transactionManager" />
  </property>
  <property name="target">
  <ref local="CxDAO" />
  </property>
  <property name="transactionAttributes">
  <props>
  <prop key="insert*">PROPAGATION_REQUIRED</prop>
  <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
  </props>
  </property>
</bean>
.............................
<bean name="/cx" class="com.xjgl.struts.actions.CxAction">
  <property name="CxDAO">
  <ref local="CxDAO"/>
  </property>
</bean>
.............................
文件struts-config.xml部分配置
<form-bean name="cxForm" type="com.xjgl.struts.forms.CxForm" />
..............................
<action input="/cxgl/cx.jsp" name="cxForm" path="/cx" scope="request"
  parameter="method" type="org.springframework.web.struts.DelegatingActionProxy">
</action>
...............................
tomcat启动时部分出错提示
ERROR - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/cx' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'CxDAO' of bean class [com.xjgl.struts.actions.CxAction]: No property 'CxDAO' found
...................................................................
Caused by: org.springframework.beans.InvalidPropertyException: Invalid property 'CxDAO' of bean class [com.xjgl.struts.actions.CxAction]: No property 'CxDAO' found
...................................................................
ERROR - Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/cx' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'CxDAO' of bean class [com.xjgl.struts.actions.CxAction]: No property 'CxDAO' found
....................................................................................................
Caused by: org.springframework.beans.InvalidPropertyException: Invalid property 'CxDAO' of bean class [com.xjgl.struts.actions.CxAction]: No property 'CxDAO' found
.................................
请问哪里出错了

[解决办法]

探讨

引用:
<bean name="/cx" class="com.xjgl.struts.actions.CxAction">
创建bean里面的name不能用‘/’对应的映射也该下

热点排行