aspose file tools*
The moose likes Servlets and the fly likes About servlet's service() method synchronize 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 "About servlet Watch "About servlet New topic
Author

About servlet's service() method synchronize

Raj chiru
Ranch Hand

Joined: Aug 12, 2008
Posts: 141
Q: can we make the service() method synchronized?
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9305
    
  17

Yes you can...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61424
    
  67

But doing so would not be wise.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sc ghosh
Greenhorn

Joined: Mar 16, 2009
Posts: 1
Yes you can do that...... but essentially you would spoil the advantage of servlets then............ it would mean that the servlet would fail to handle multiple client requests at the same time............. it would just be like implementing the SingleThread model.............. you should refrain from doing this................
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

"java ninja", please check your private messages.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About servlet's service() method synchronize