Problème de définition d'action
Bonjour à tous,
Bon voila, je commence tout juste avec Struts2. J'ai récupéré l'archetype d'un projet Struts2 avec Maven qui m'a créé un beau projet.
J'ai définis toutes mes dépendances comme il se doit. Puis j'ai essayé d'intégrer Spring en suivant ce tuto : http://struts.apache.org/2.0.8/docs/...-jpa-ajax.html
Malheureusement, mes actions Struts sont introuvables...
Je vous joins mon struts.xml :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.objectFactory" value="spring" />
<constant name="struts.devMode" value="true" />
<package name="person" extends="struts-default">
<action name="list" class="personAction" method="execute" >
<result>jsp/list.jsp</result>
<result name="input">jsp/list.jsp</result>
</action>
<action name="remove" class="personAction" method="remove">
<result>jsp/list.jsp</result>
<result name="input">jsp/list.jsp</result>
</action>
<action name="save" class="personAction" method="save">
<result>jsp/list.jsp</result>
<result name="input">jsp/list.jsp</result>
</action>
</package>
</struts> |
et mon applicationContext.xml :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
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="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<bean
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<bean id="personService" class="com.service.PersonServiceImpl" />
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="jpaVendorAdapter">
<bean
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="database" value="" />
<property name="showSql" value="true" />
</bean>
</property>
</bean>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
<property name="url" value="jdbc:oracle:thin:@localhost:1521:xe" />
<property name="username" value="" />
<property name="password" value="" />
</bean>
<bean id="transactionManager"
class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
<bean id="personAction" scope="prototype"
class="com.action.PersonAction">
<constructor-arg ref="personService" />
</bean>
</beans> |
Lorsque je vais sur mon index.jsp, il me sort une 404 en me disant qu'il n'existe pas d'action pour le namespace.
Ca fait deux jours que je suis sur ce problème et ça commence légèrement à me saouler... J'espère que vous pourrez me dépanner.
Merci d'avance.