Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

static blocks in servlels

 
manasa teja
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sometime back, somewhere, I read that, we are not supposed to use static blocks in servvlets. Is it because, teh static blocks gets executed during initiaon.
Can someone explain the reason with example.
ram
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know of no reason to avoid static initialization blocks in servlets and I have used them occasionally.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic