• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletConfig in Constructor

 
Divyya Joshi
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone please tell why can't we use ServletConfig in constructor?
I read Kathy Sierra for SCWCD-1.5 but still i am not able to understand the exact reason
Please guide me.
Thanks in advance.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simple explanation: That is not the way it (the servlet API) works!

The architecture of having a container create an instance with a no-args constructor combined with a separate initialization method is common in Java, get used to it.

Bill

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic