integrate struts2 and spring plugin

436 Views Asked by At

I try to develop a web application (Struts 2, Spring, Hibernate) using Maven, in eclipse. I first create a simple Maven project, I joined Struts2, and everything goes perfectly. When I tried to integrate Spring and struts2-spring-plugin, I always have a 404 error. Once I remove the dependence of struts2-spring-plugin my pom.xml, the application running again.

<dependency>
    <groupId> org.apache.struts </groupId>
    <artifactId> struts2-spring-plugin </artifactId>
    <version> 2.3.16.3 </version>
</dependency>
2

There are 2 best solutions below

2
On

Do you have already defined the object mapper like explained in the struts2 spring plugin documentation?

<struts>
  <constant name="struts.objectFactory" value="spring" />
  ... 
</struts>

If you have defined it would be great if you could provide some more details about your config and your log messages.

0
On

you are not forced to add struts2-spring-plugin to work wirh spring, hibernate and struts. I work with project containing spring, struts2, hibernate and spring security and i dont have a configuration problem. You just should keep attention to the versions. Spring version should be the same to spring security version, but for struts 2 and hibernate there is no conflicts.