当前位置: 代码迷 >> Java Web开发 >> 关于ssh框架文件映射的有关问题
  详细解决方案

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

热度:9613   发布时间:2013-02-25 21:12:20.0
关于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不能用‘/’对应的映射也该下
  相关解决方案