File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Android Security Essentials Live Lessons this week in the Android 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: 9291
    
  17

Yes you can...


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

Joined: Jan 10, 2002
Posts: 60806
    
  65

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
 
 
subject: About servlet's service() method synchronize
 
Similar Threads
Post to Servlet from Applet doesn't work
protected Method service???
Did implicit objects are instance variables or local variables in _jspService
Web service method call behaviour?
servlets