Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Can i call init() method in destroy method.?

  1. #1
    Junior Member muralidhar's Avatar
    Join Date
    Jan 2010
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Post Can i call init() method in destroy method.?

    Hello friends,

    Can i call init() method in destroy() method in my servlet life cycle.Can you justify this question.


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,355
    Thanks
    182
    Thanked 833 Times in 776 Posts
    Blog Entries
    5

    Default Re: Can i call init() method in destroy method.?

    Not sure why you would want to...init is used to set up any states necessary for the servlet, and destroy to do the opposite. If you think you need to call init from destroy, then I'd suggest pulling out the things in init you wish to perform in destroy into its own function that both methods can call independent of one another.

Similar Threads

  1. Can't run the method, Please help!!
    By mingming8888 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 20th, 2010, 08:13 AM
  2. [SOLVED] Another Method,
    By Time in forum Algorithms & Recursion
    Replies: 4
    Last Post: June 28th, 2010, 10:52 PM
  3. Looking for a method,
    By Time in forum Algorithms & Recursion
    Replies: 7
    Last Post: May 15th, 2010, 01:24 PM
  4. [SOLVED] Method declaration in Java
    By mohsendeveloper in forum Object Oriented Programming
    Replies: 4
    Last Post: June 11th, 2009, 04:18 AM
  5. [SOLVED] Java exception "result already defined"
    By rptech in forum Object Oriented Programming
    Replies: 3
    Last Post: May 20th, 2009, 06:48 AM

Tags for this Thread