• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

scope prototype not being thread-safe

 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
struts 2.1.8.1
spring 3.0.2
struts2-spring-plugin-2.1.8.1


Hello:

I have a web application where at times, users will "see each other's sessions". The only thing that seems possible is that the instances of actions I have defined are being shared by multiple users, even though I have given each scope="prototype". Here is a sample action:

<bean id="summaryAction" class="xxx.yyy.SummaryAction" scope="prototype">
<property name="xxxxAPI">
<ref bean="xxxxAPI" />
</property>
</bean>

Each Action in the applcation subclasses a base action which also has scope="prototype" set.


Here is the relevant entry from struts.xml:

<action name="summaryRefreshMain" class="summaryAction" method="refreshMainPage">
<param name="privilege">XXXX</param>
<result name="success" type="tiles">/summaryMain</result>
<result name="input" type="tiles">/summaryMain</result>
</action>


The Actions do not reference each other in any way or store session values in a stateful way.

Any ideas would be appreciated.

Eric

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic