If you want to use the Hibernate Session and Transaction injection capability, your action mapping package need to extend the package hibernate-default
.
More details about hibernate-default
package
The plugin provides a mapping package called hibernate-default
. And this has three interceptor stacks indicated for injection capabilities:
basicStackHibernate
: Like Struts2basickStack
(NO validations!), but with Hibernate session and transaction injections capability.defaultStackHibernate
: Like Struts2defaultStack
, but without Struts2 validation methods (annotation and XML). Uses Hibernate Validation framework instead.defaultStackHibernateStrutsValidation
: Struts2defaultStack
+ plugin'sbasicStackHibernate
.
This package extends the hibernate-default
package, so all default Struts2 configurations can be used if you need.
hibernate-default
package is abstract, so you can extends this with other. For example:
<package name="default" extends="hibernate-default,json-default" >
To use hibernate-default
with an annotation configuration use
@ParentPackage("hibernate-default")
@InterceptorRef("basicStackHibernate")
public class YourAction extends ActionSupport {}