qq_22939371 2015-05-07 12:29 采纳率: 0%
浏览 1947
已结题

SSH整合问题Unable to instantiate Action

问题:Unable to instantiate Action, userAction, defined for 'user-userLogin' in namespace ''userAction
不知道哪里问题,网上的方法试了好多遍,都没解决,客户端只能停留在登录界面,无法登录成功,无法访问服务器,求大神指教
Struts.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">







</package>

beans.xml
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">
context:annotation-config/

<property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<property name="url" value="jdbc:sqlserver://localhost:1433;DatabaseName=intelligent_tutoring"/>
<property name="username" value="sa"/>
<property name="password" value="1234"/>





com.it.bean





org.hibernate.dialect.SQLServer2008Dialect

true
none
update



class="org.springframework.orm.hibernate3.HibernateTransactionManager">


class="org.springframework.orm.hibernate3.HibernateTemplate">


tx:attributes
<!-- -->

/tx:attributes
/tx:advice
aop:config


/aop:config

  • 写回答

2条回答 默认 最新

  • 夜独醉╋心碎 2015-05-14 07:38
    关注

    <?xml version="1.0" encoding="UTF-8"?>
    xmlns="http://www.springframework.org/schema/beans"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-2.5.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

     <!-- 定义组件扫描的基本包 -->                   
    <context:component-scan base-package="com.*.service,com.base,com.system.dao"></context:component-scan>                 
    
     <!--  数据源 -->                  
    <bean id="dataSource"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName"
            value="oracle.jdbc.driver.OracleDriver">
        </property>
        <property name="url"
            value="jdbc:oracle:thin:@10.0.4.58:1521:orcl">
        </property>
        <property name="username" value="scott"></property>
        <property name="password" value="tiger"></property>
    </bean>  
    <!-- sessionFactory -->                
    <bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <property name="dataSource">
            <ref bean="dataSource"/>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">
                    org.hibernate.dialect.Oracle9Dialect
                </prop>
                <prop key="hibernate.show_sql">true</prop>
            </props>
        </property>
    
        <property name="annotatedClasses">
            <list>
                <value>com.model.Mapmark</value>
                <value>com.model.Maplist</value>
                <value>com.model.Mapxzqh</value>
    
            </list>
        </property>
    </bean>
    
    <!-- 事务管理器   -->
    <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
    </bean>
    <tx:annotation-driven/>
    </beans>
    

    这个 是我 的页面,而且 这个 配置 我是写在 spring.xml里的

    下面这个页面是struts.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
    "http://struts.apache.org/dtds/struts-2.1.dtd">

    <!--定义全局package -->




    <!--把自己的拦截器添加到定义的拦截器栈里面-->


    <!--定义自己的拦截器-->
    class="com.base.interceptor.InvocationHandler" />

    <!--调用拦截器-->

    </package>
    

    如果 帮你解决问题 请采纳 谢谢

    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?