Announcement Announcement Module
Collapse
No announcement yet.
Bean becomes singleton after adding sec:intercept-methods tag Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bean becomes singleton after adding sec:intercept-methods tag

    I have a struts2 controller bean that is defined thus:

    Code:
    <bean id="postingController" scope="prototype" class="com.Yasna.iclassified.posting.PostingController">
            <property name="dao"><ref bean="postingDAO"/></property>
            <property name="categoryDAO"><ref bean="categoryDAO"/></property>
            <property name="propertyDAO"><ref bean="propertyDAO"/></property>
            <property name="dataElementDAO"><ref bean="dataElementDAO"/></property>
            <property name="mutableAclService"><ref bean="aclService"/></property>
            <sec:intercept-methods access-decision-manager-ref="accessDecisionManager">
    	        <sec:protect method="com.Yasna.iclassified.posting.PostingController.save" access="ACL_POSTING_WRITE"/>
            </sec:intercept-methods>
        </bean>
    without the sec:intercept methods tag spring honours the prototype scope, with it it creates a singleton which messes Struts2 up no end (the bean never makes it onto the value stack). I am pretty new to Spring so can someone tell me if I am doing something wrong and perhaps suggest a solution?
Working...
X