0

I have a project with spring container and prime-faces for UI elements. I Use Tomcat as application server. My managed-beans scope is @ViewScoped. when I load an entity in a page and then I open that page in another browser, I see the same page that is loaded before. what happens to my project in real server with lots of clients. Are they going to see same page when someone load or filtered a page.

@ManagedBean
@ViewScoped
@Controller
public class AlarmController implements Serializable 
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Ramin PK
  • 338
  • 1
  • 5
  • 16
  • 1
    JSF didn't do that. Spring did that. – BalusC Aug 16 '15 at 07:29
  • 1
    This is because the bean is marked "singleton" which is shared across all potential sessions on the server. You will instead need a narrower scoped bean like a view scoped bean or perhaps, a request or session scoped bean depending upon the business requirement. – Tiny Aug 16 '15 at 11:43
  • thanks .My fault was using Controller and Autowired becuase of spring singleton. I used ManagedProperty and my problem solved . – Ramin PK Aug 18 '15 at 11:37
  • The question doesn't necessarily need to be the same to satisfy a duplicate, nor its findability. The answer is exactly the same. It would make no sense to copypaste that answer into a different question. Duplicates aren't bad. Duplicates are good. They feed the search engines with new keywords, so future users can find them quicker. So, thank you for asking this duplicate ;) – BalusC Aug 18 '15 at 11:38
  • @BalusC thank you so much. – Ramin PK Aug 18 '15 at 11:40

0 Answers0