CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 1999
    Location
    India.
    Posts
    81

    function for every request

    Hi,
    I am making a servlet in which I have made user defined functions eg myfunction(). Now doGet()
    is instantiated for every request and it is calling myfunction().I want to know whether myfunction() too, would be instantiated every time ,or not?

    Thanks in advance.
    Monika


  2. #2
    Join Date
    May 1999
    Location
    Pune, MH, India.
    Posts
    453

    Re: function for every request

    In java a method is never instantiated. What is instantiated is a class.

    In case of servlets... normal servlet will be instantiated only ONCE. After that there will be different threads for each request which will run methods in that class (like multi-threading).

    If you make the servlet 'Single-Threaded', then also that servlet 'class' is instantiated for each request and not only specified method.

    - UnicMan
    http://members.tripod.com/unicman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured