aspose file tools*
The moose likes Servlets and the fly likes MVC pattern doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "MVC pattern doubt" Watch "MVC pattern doubt" New topic
Author

MVC pattern doubt

Suresh Yadla
Greenhorn

Joined: Mar 26, 2005
Posts: 12
If I have an website with MVC pattern, and I have the servlet, JSP, and Bean.

In this scenario, if two users log in at the same time and the some state is store in bean then wouldn't there be a conflict or will each user have its own bean where some state/data could be kept for a while.

If there is a conflict then why should we use MVC pattern.

Suresh


Suresh Yadla<br />SCJP, SCWCD, SCBCD<br /> <br />----------------------------------
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

A servlet is a multi threaded object.
Each request is handled within it's own thread.
As long as you instanciate your bean from within one of the service methods there will be no concurrency issues.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61424
    
  67

Which all has little to nothing to do with MVC.
[ June 07, 2005: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MVC pattern doubt