Announcement

Collapse
No announcement yet.

adding spring to struts2

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • adding spring to struts2

    hallo leute,
    ich habe eine web app projekt!
    spring 2.5.3
    (spring-web, spring-jdbc, spring-tx, spring-mock, spring-orm, spring-beans, spring-core, spring-context), struts2 2.1.6, jboss-5.0.1.

    applicationContext.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" default-autowire="autodetect"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xsi:schemaLocation="
       Index of /schema/beans http://www.springframework.org/schem...-beans-2.0.xsd
       Index of /schema/tx http://www.springframework.org/schem...ing-tx-2.0.xsd
       Index of /schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">
     
     
     
        <bean id="webStoreLogin"
            class="org.springframework.ejb.access.LocalStatelessSessionProxyFactoryBean">
            <property name="jndiName" value="GamigoWebStore/WebStoreLogin/local" />
            <property name="businessInterface" value="de.gamigo.services.domain.IWebStoreLogin" />
        </bean>
     
        <bean id="loginAction" 
                class="de.gamigo.webStore.store.presentation.struts.LoginAction" scope="prototype">
    <!--        <property name="webStoreLogin" ref="webStoreLogin" />-->
                <constructor-arg ref="webStoreLogin"/>
        </bean>
    </beans>
    struts.xml
    Code:
    <struts>
     
        <constant name="struts.objectFactory" value="spring" />
    <!--    <constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory" />-->
        <constant name="struts.objectFactory.spring.autoWire" value="name" />
        <constant name="struts.devMode" value="false" />
        <constant name="struts.configuration.xml.reload" value="false" />
        <constant name="struts.custom.i18n.resources" value="ApplicationResources" />
        <constant name="struts.i18n.encoding" value="UTF-8"/>
        <constant name="struts.i18n.reload" value="false"/>
     
     
        <!-- Configuration for the default package. -->
        <package name="" extends="struts-default">
     
            <!-- Default interceptor stack. -->
            <default-interceptor-ref name="paramsPrepareParamsStack" />
     
            <global-results>
                <result name="error">/WEB_INF/jsp/error.jsp</result>
            </global-results>
     
            <!-- m.kemal struts config begin -->
            <action name="index" class="loginAction">
                <result>/WEB-INF/jsp/login.jsp</result>
                <result name="success">/WEB-INF/jsp/home.jsp</result>
                <result name="error">/WEB-INF/jsp/login.jsp </result>
                <result name="AGB">/WEB-INF/jsp/acceptAGB.jsp </result>
            </action>
    web.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
        id="WebApp_ID" version="2.5">
        <display-name>GamigoWebStore</display-name>
        <context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>
                classpath*:applicationContext*.xml
            </param-value>
        </context-param>
        <listener>
            <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
        </listener>
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
     
        <filter>
            <filter-name>struts</filter-name>
            <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
        </filter>
        <filter-mapping>
            <filter-name>struts</filter-name>
            <url-pattern>/*</url-pattern>
        </filter-mapping>
    LoginAction
    Code:
    public class LoginAction extends ActionSupport {
    .
    .
    .
    public String execute() {
    und dann habe ich folgende fehler meldung.
    Exeption
    Code:
    Unable to instantiate Action, loginAction,  defined for 'index' in namespace '/'loginAction from BaseClassLoader@147f75{VFSClassLoaderPolicy@1bc12c9{name=vfszip:/usr/local/jboss-5.0.1/server/default/deploy/
Working...
X