I have read through the spring plugin wiki page
http://struts.apache.org/2.0.11/docs/spring-plugin.html for struts2.

I want my actions to be completely managed by spring, so i am declaring them
in applicationContext.xml.


<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans";

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";

xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd

http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.0.xsd

http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd

http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd";

xmlns:aop="http://www.springframework.org/schema/aop";

xmlns:tx="http://www.springframework.org/schema/tx";

xmlns:util="http://www.springframework.org/schema/util";>



<bean id="com.cerner.healthe.struts2.action.AccountResendAction"

      class="com.cerner.healthe.struts2.action.AccountResendAction"
singleton="false">

      <property name="userService"

                ref="com.cerner.healthe.struts2.service.UserService" />

      <property name="provisioningService"

                ref="com.cerner.healthe.struts2.service.ProvisioningService" />

</bean>



...

</beans>


However, when starting my application, spring throws an error:

*

org.xml.sax.SAXParseException*: cvc-complex-type.3.2.2: Attribute
'singleton' is not allowed to appear in element 'bean'.

I have also found an older version of the wiki page
http://cwiki.apache.org/WW/spring.html that gives an explanation of the
'singleton' attribute:

The singleton attribute is set to false, meaning that Spring will create a
new Action class upon each request, as Struts 1 would do.

Is this attribute no longer necessary?

Reply via email to