Discussions

EJB design: purpose of super.init(config)

  1. purpose of super.init(config) (3 messages)

    Hi,

    Why do we need to call super.init(config) in the init method of a servlet?

    Thanks in advance,
    Naresh Tirunagari

    Threaded Messages (3)

  2. Hi,Why do we need to call super.init(config) in the init method of a servlet?Thanks in advance,Naresh Tirunagari
    I believe it is used to initialize the ServletConfig Object,
    Correct me if i am wrong.
  3. purpose of super.init(config)[ Go to top ]

    The container constructs ServletConfig object by using servlet init parameters given in DeploymentDescriptor so it can be available in servlet.
  4. purpose of super.init(config)[ Go to top ]

    If you really don't like calling super.init(config), the you should override the servlet's init() method [with no parameters] instead of init(ServletConfig). This way, the ServletConfig will be properly initialized with no special action on your part.