Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

destroy servlet ?

 
Micheal Quai
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


my question is why use context to destroy a servlet ?(iam from china and my english is not good)
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All of that is unnecessary, including storing the servletContext as an instance variable.
 
Micheal Quai
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the servlet code above has been overided the init(servletConfig config) .

 
Micheal Quai
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the servlet code above has been overided the init(servletConfig config) .

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Again, it is unnecessary to store a reference to the servlet context -- it can easily be obtained from any request. It's also considered poor practice to override init(ServletConfig); you should be overriding init() (the one with no parameters).
 
Micheal Quai
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for help me .
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what we are here for!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic