spring配置:
<bean id="userAction" class="com.cuc.uaction.UserAction" scope="prototype">
<property name="userDAO" ref="userDAO"></property>
</bean>
<bean id="userDAO" class="com.cuc.dao.imp.UserDAO" >
<property name="sessionFactory" ref="sessionFactory"></property>
</bean>
<!-- 配置sessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="datasource"></property>
<property name="configLocation" value="classpath:hibernate.cfg.xml">
</property>
</bean>
<!-- 配置事务管理器 -->
<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<!-- 配置事务的传播特性 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager" >
<tx:attributes>
<tx:method name="insert*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="change*" propagation="REQUIRED"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>
<!-- 那些类的哪些方法参与事务 -->
<aop:config>
<aop:pointcut id="allServiceMethod" expression="execution(* com.cuc.dao.imp.*.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="allServiceMethod"/>
</aop:config>
jsp:
<form onsubmit="return check_form()" name="update-form" target="_self" method="post" style="float: left;" action="<%=basePath%>user_update.action">
UserAction:
public String update() throws Exception{
HttpServletRequest request = ServletActionContext.getRequest();
............
}
type Exception report
message Invalid action class configuration that references an unknown class named [userAction]
description The server encountered an internal error that prevented it from fulfilling this request.
exception
java.lang.RuntimeException: Invalid action class configuration that references an unknown class named [userAction].........
root cause
java.lang.ClassNotFoundException: userAction..........
你用了spring-mvc吗?看下@contorller注解吧
XXAction,看来你使用了struct,建议配置struct部分内容,或者使用SpringMVC用struts的话就在struts配置文件里配置 user_update;
用springmvc的话就配置好action的return映射和@RequestMapping;
还有,看你报错应该是用的struts的通配吧,这样<actionname="*_*"method="{2}"class="{1}Action">
用struts的话就在struts配置文件里配置 user_update;
用springmvc的话就配置好action的return映射和@RequestMapping;
还有,看你报错应该是用的struts的通配吧,这样<actionname="*_*"method="{2}"class="{1}Action">
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。