aspose file tools*
The moose likes Struts and the fly likes scope prototype not being thread-safe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "scope prototype not being thread-safe" Watch "scope prototype not being thread-safe" New topic
Author

scope prototype not being thread-safe

John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
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

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: scope prototype not being thread-safe
 
Similar Threads
Newbie -Struts - Exception
Could not get the connection in struts database application
HTTP Status 404 - Servlet action is not available
Struts Spring Integration problem
tiles definition error, maping .(dot) error