|
From: Lachezar D. <l.d...@gm...> - 2008-06-09 07:35:39
|
You also need to post the code where you obtain references to the bean. Commonly people miss the fact, that prototype beans are instantiated on every obtaining, not on every call. When a property of a singleton class is referencing a prototype bean the property value has the same scope as the referencing bean, not the referenced one. 2008/6/9 Jaga <v.j...@gm...>: > > hi, > > When I tried with the prototype scope in spring, on opening two browsers > there > is only one instance is created. > > Hence the value of the recently accessed instance by the user is retrieved. > > version used: spring-beans-2.0.xsd > > Snippet: > > <?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"> > > <bean id="obj1" class="com.dto.Class1" scope="prototype"> > </bean> > > Please help. > > -- > View this message in context: http://www.nabble.com/Protype-Scope-of-Spring-Bean---creates-problematic-singleton-instance-tp17727103p17727103.html > Sent from the springframework-developer mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |