• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletContext doubt??

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

Page 163 of the HFSJ book says that "You can get a ServletContext in 2 different ways...

getServletConfig().getServletContext().getInitParameter()

and

this.getServletContext().getInitParameter()

I'm not able to realize this. Can anyone explain it more elaborately.

Thansk in advance.
 
Sayak Banerjee
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.servlet.ServletConfig as well as javax.servlet.GenericServlet both have the method getServletContext()
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic