Servlet Life Cycle. .can anybody say whether this is correct or not

Hello everyone
Servlet Life Cycle.This is what i understood .can anybody say whether this is correct or not
According to sevlet specification,servlet life cycle has 4 stages
1)Loading and instantiation
2)Initialization
3)service the request
4)destroy
When we start webcontainer, webcontainer looks for deployed web applications and reads deployment descriptor of each web application.In the process of reading web.xml webcontainer container creates servletcontext object for holding context parameters and servletconfig object for holding servlet init-parameters after finding the servlet classes of the web application.
After finding the servlet classes webcontainer loads the servlet classes.
Loading can be done in 2 ways
1)When Webcontainer starts(loads) the webaplication by using load on startup in web.xml.
or
2)when first request comes for the webapplication
Say webcontainer starts the webaplication by using load on startup in web.xml ,Webcontainer creates an instance of servlet class and call init method of GenericServlet class by passing ServletConfig as parameter to init method i.e init(ServletConfig config).The code that is part of this init method initilize the ServletConfig variable of GenericServlet class and call init() method of GenericServlet class.
So when a request comes,webcontainer creates HttpServletRequest object,
HttpServletResponse object ,identifies the servlet class based onthe URL and
allocates a thread for the request and calls
service(ServletRequest req,ServletResponse resp) of HttpServlet class by
passing HttpServletRequest object, HttpServletResponse object as arguments.
Since req,resp are of type ServletRequest,ServletResponse they are type
casted to HttpServletRequest , HttpServletResponse and calls
service(HttpServletRequest req,HttpServletResponse resp) of HttpServletand
here request method is determined and either doGet()/doPost() methods are executed.
And finally when desroy method is called.

Mostly, but a servlet that has been initialized may service any number of 0 or more requests before being destroyed. So the life cycle might be:
1) Load
2) Initialize
3) Service a Request
4) Destroy
or
1) Load
2) Initialize
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
4) Destroy
or
1) Load
2) Initialize
4) Destroy
For any given <servlet> definition, you might have a combination of all:
1) Load (instance 1)
2) Initialize
4) Destroy
1) Load (instance 2)
2) Initialize
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
3) Service a Request
4) Destroy
1) Load (instance 3)
2) Initialize
3) Service a Request
4) Destroy
And for some Servlets with special configurations you might get:
1) Load (instance 1)
2) Initialize
1) Load (instance 2)
2) Initialize
1) Load (instance 3)
2) Initialize
3) Service a Request (instance 1)
3) Service a Request (instance 2)
3) Service a Request (instance 3)
3) Service a Request (instance 2)
3) Service a Request (instance 2)
3) Service a Request (instance 2)
3) Service a Request (instance 1)
3) Service a Request (instance 2)
3) Service a Request (instance 2)
3) Service a Request (instance 3)
3) Service a Request (instance 1)
4) Destroy (instance 1)
3) Service a Request (instance 2)
4) Destroy (instance 3)
4) Destroy (instance 2)
Finally, if you have multiple <servlet> entries in the web.xml (maybe with different servlet names and mappings) then you could have multiple parallel chains of this sort of life-cycle.
The key concept you have is correct. But once you understand that it is important to know that you really have no control over the lifecycle of the Servlet and that you should not assume anything about it.

Similar Messages

  • Can anybody say why In the layer menu the background color is white when opening a layer mask, and why does it automatically turns black by simply opening the layer mask properties menu? The vector mask is white anyway.

    Can anybody say why In the layer menu, the background color is white when opening a layer mask, and why does it automatically turns black by simply opening the layer mask properties menu? The vector mask is white anyway.

    Topic or subject titles should be clear, pertinent and concise so that individual users can tell at a glance if they can help or not.
    That field is not for attempting to fit your entire question in there.
    Please keep this in mind next time you post.  Thank you.
    A lot more information about your hardware and software is needed.
    BOILERPLATE TEXT:
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CC", but something like CC2014.v.2.2) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    a screen shot of your settings or of the image could be very helpful too,
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • I wish to download (and use of course) Creative Cloud on my NAS to be able to have access from various locations using my laptop PC and tablet. Does anybody know whether this is possible? So the programm software at the NAS and operate it from there.

    I wish to download (and use of course) Creative Cloud on my NAS to be able to have access from various locations using my laptop PC and tablet. Does anybody know whether this is possible? So the programm software on the NAS and operate it from there.

    OK, thanks
    but EULA ?? what does it stand for? I am pretty new to all this so good to learn something.
    ps. backgroud of my request is, that I purchased LR in a box in 2013. The computer where this is on, is at the end of its life and I have no LR box with License or any reference nr's anymore.
    Copied to my new Laptop, which maybe is not allowed if I understand you correct, it didn't work.
    Pitty, because afterall it is still my legally relatively recent purchased LR version.
    I thought to overcome this problem in future by putting it on my NAS. Safe for many years to come.
    again any knowlegeable feedback is welcome to me.
    Jos

  • I cannot open iCal because of a problem. Can anybody help me? The computer will not allow it to open and sends a message to apple each time. The icon has gone from the dock, but ical works on my iPad and I am afraid to sync it with my computer.?

    I cannot open iCal because of a problem. Can anybody help me? The computer will not allow it to open and sends a message to apple each time. The icon has gone from the dock, but ical works on my iPad and I am afraid to sync it with my computer in case it wipes everything .

    I have the exact same problem. I have not changed anything. This is probably a bug or something that has gone bad with Mac OS X (10.7.2). I have not found any solution for this on the web.
    MacBook Pro, Mac OS X (10.7.2).

  • When i try to authorize by computer its saying that "This Apple ID has not yet been used with the iTunes Store."

    When i try to authorize by computer its saying that "This Apple ID has not yet been used with the iTunes Store." please someone help me

    I had this same problem today. I have been battleing it for the past 5 hours, but it worked. You have to create a new account though.
    What I did was go to iTunes and click Sign in, then made a new account.
    But I didn't want to put in a Credit Card number, so what I did was
    Open iTunes
    Go to iTunes Store
    Search a totaly free app. (I used Google Earth)
    Click on the app from the list
    Click the button under the icon that says "Free App"
    Then it will ask you to sign in or make a new account, Select Make New Account
    Follow All the steps on all the pages.
    When you get to the page that you select your Credit Card, check "None"
    Fill in the rest of the info and then click Complete
    Verify your email
    I hope this helped you. Strangely, you can only select "None" Under Credit Card if you do it this way. Must be some iTunes bug.

  • My IPad cannot download live Tv from skygo. I have no problem with my lap top so I assume the broad band is okay. Can anybody suggest why the live streaming will not work on my iPad one.

    My IPad cannot download live Tv from skygo. I have no problem with my lap top so I assume the broad band is okay. Can anybody suggest why the live streaming will not work on my iPad .

    Are you using the Sky Go app to try and watch it ? If so are you logged in with your Sky account ?
    If you are using the app then you could try closing the app completely and see if it works when you re-open it : from the home screen (i.e. not with Sky Go 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Sky Go app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    If that doesn't work then you could try a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • I created an apple id and tried to authorize my computer but it says that this apple id has not yet been used with the itunes store, why?

    I created an apple id and tried to authorize my computer but it says that this apple id has not yet been used with the itunes store, why?

    FAQ apple id http://support.apple.com/kb/HT5622?viewlocale=en_US
    http://support.apple.com/kb/HT1311

  • HT1222 My iPhone 5 keeps saying I don't have enough storage to update software even though I just purchased 15GB of storage. Can anybody please explain this to me? I'm really not tech savvy AT ALL so I don't have a clue what to do :(

    My iPhone keeps telling me I don't have enough space to update my software. But I just bought 15GB of storage, of which 11.7GB is free! So I don't understand. Can anybody please help me? I'm really bad with technology so I don't have a clue.

    Hi Caroline,
    The storage issue you are having is not related to iCloud. The error is telling you that you do not have enough room on your device itself. You need to go to Settings>General>Usage, and under the Storage section at the top, it lists all of your apps and other things taking up room on your device.
    You will have to delete or reduce the size of items on this list in order to free up some room for your update.
    Also, you may want to try the update by hooking up your device to iTunes on the computer you sync with. It does not require as much free memory to update via iTunes as it does OTA.
    Cheers,
    GB

  • Servlet life cycle/Singleton pattern/synchronized

    I have some questions about the life cycle of a servlet and the use of synchronozed.
    We have a main controller class that is extended from HTTPServlet and accepts all HTTP requests. It in turn instantiates another class to do the work. That class eventually returns control to the main controller and the request is forwarded. It is a typical MVC.
    1. Once the helper class is instantiated how long will it live? We never destroy the class. I can debug the class using JBuilder and see variables set from the previous access.
    2. While the class is in memory, if two or more requests are requiring the use of it, is a copy of the class created and used by each request. These particular classes are not instantiated as 'private static' instances.
    3. If no copy is made, will the requests wait for the other to finish its processing before it gains control of the class. If no, I am assuming that proper use of synchronized will eliminate any issues.
    4. Anyone have advice on where and when to synchronize or do you know of any good articles on this topic.
    Thanks in advance for any advice you can give.

    Hello,
    Many of your question depends on where you declare the helper class, so here it goes:
    1) The helper class will stay in memory as long as it's scope lasts. Ie: If you declare it as an instance member of the servlet it will stay alive until the servlet is unloaded by the application engine.
    2) In short, local and parameter members, yes. Instance members no.
    3) Most servlet configurations servers multiple requests on the same servlet. So if your helper class is an instance member it can be accessed be multipe threads at the same time. You can also declare that your servlet is not thread safe and the application engine will create multiple copies of it instead.
    4) Er... Have a look around. I'm sure there are several examples and tutotrials on this site alone.
    Yours
    - Lars J. Nilsson

  • Hi want to convert a number in crore, e.g. 10000000 to 1.00 Can anybody help on this?

    Hi All,
    I want to convert a number in crore format.
    My basic problem is, I am using a custome format:
    #,##0.00,,,%;
    Here main task is done by ,,,%.
    Each comma (,) is dividing a number by 1000. Thus three commas are dividing a number by 10^9 digits.
    But I need number in crore (i.e. 10^7), Thus we have used this percent sign (%).
    Here I can get required Value but appended percent (%) to it. I can temporary hide this using wrap text.
    But I need exact solution to convert a number in crore.
    Can anybody help me regarding the same.

    Hi Neha,
    You can use EPMScaleData function, in that give scaling factor as per your requirement.
    For more details you can go through following link
    How to use EPMScaleData in a fully dynamic report
    Regards,
    Shrikant

  • I am getting the following error in DAC, can anybody look into this ?

    Hi All
    I am getting the following error in DAC while Registering Informatica Services & repository services in DAC ?
    This is for RS(Repository services):
    ======================
    Failure connecting to "BIA_RS"!
    ANOMALY INFO::: Error while pinging informatica repository server
    MESSAGE:::F:\DAC\bifoundation\dac\log\pmrepConnect.log (The system cannot find the file specified)
    EXCEPTION CLASS::: java.io.FileNotFoundException
    java.io.FileInputStream.open(Native Method)
    java.io.FileInputStream.<init>(FileInputStream.java:106)
    java.io.FileInputStream.<init>(FileInputStream.java:66)
    com.siebel.etl.functional.ReadFileToBuffer.readFileToBuffer(ReadFileToBuffer.java:39)
    com.siebel.analytics.etl.infa.interaction.PmrepInvoker.pmrep(PmrepInvoker.java:100)
    com.siebel.etl.gui.data.StaticDatabaseCalls.testRepositoryServer(StaticDatabaseCalls.java:959)
    com.siebel.etl.gui.data.StaticDatabaseCalls.testInformaticaServer(StaticDatabaseCalls.java:890)
    com.siebel.etl.net.ExecutionPlan.getInformaticaStatus(ExecutionPlan.java:275)
    com.siebel.etl.net.ClientMessageDispatcher$WorkerThread.mBeanRequestInformaticaStatus(ClientMessageDispatcher.java:433)
    com.siebel.etl.net.ClientMessageDispatcher$WorkerThread.consoleMessage(ClientMessageDispatcher.java:224)
    com.siebel.etl.net.ClientMessageDispatcher$WorkerThread.run(ClientMessageDispatcher.java:144)
    This is for IS(integration services):
    ====================
    Failure connecting to "BIA_IS"!
    Can anybody please provide the solution for this ?
    Regards
    Srini
    Edited by: Srini on Feb 26, 2012 4:58 AM

    Check weather Your able to Ping Data warehouse, might be your ETL is not able to ping DW.

  • Can anybody help with this........I've bought a pack of self adhesive lables with a view to printing them via my printer,  However, I can't find a programme that allows me to do this.  Personnel in the MAC shops don't know either!!  I've a IMAC running on

    I've bought a pack of self adhesive labels that I wanted to print up on my IMAC,running on Snow Leopard.  However, I can't find a programme that will do this, nor can the personnel in the MAC shops.  The labels are stuck on a normal sheet od A4, and I just want to print addresses on them.   Can anybody help?

    Are they Avery Labels? If so there are templates here:
    http://www.avery.com/avery/en_us/Templates-&-Software/Templates

  • Can anybody come accorss this SLS not sis?

    hi all gurus,
    i am very thankful to u all
    am getting everything from sdn...
    can anybody explain about SLS not sis?
    ok thank u
    vasan

    Sales is a process, which consist of sales cycle as under (in SAP):
    Inquiry (Optional) - Transaction Code: VA11 / VA12 / VA13
    Quotation (Optional) - Transaction Code: VA21 / VA22 / VA23
    Sales Order - Transaction Code: VA01 / VA02 / VA03
    Delivery (Create Delivery (Required), Packing (Optional), Picking (Optional), Post Goods Issue (Required)) - Transaction Code: VL01N / VL02N / VL03N
    Invoice / Billing Document - Transaction Code VF01 / VF02 / VF03
    Regards,
    Rajesh Banka
    Reward points if helpful.

  • How can I disable the "this PDF document might not be displayed correctly" notification?

    Almost all PDF files produce the "this PDF document might not be displayed correctly" message when viewed with the built-in PDF viewer.
    This message does not convey useful information. It appears on almost all PDF files (even though they usually work correctly after all); it sometimes fails to appear even on files that don't work (so it does not accurately predict whether a given file will work); when a file doesn't work, there is no way to make it work short of using an external viewer (so the error I'm being warned about is not something I can fix); and it demands a user action to dismiss it EVERY TIME it appears (so it places a disproportionate demand on my attention). How can I disable it?
    Please note that I am not looking for instructions on how to disable the built-in PDF viewer. I just want to turn off the warning message.

    The only way to stop this message is to disable the built-in PDF Viewer and use another viewer.<br />
    On Linux you only have an older version of the Adobe Reader available, so you may have to open the PDF files in an external viewer like evince.
    You can set the pdfjs.disabled pref to true on the <b>about:config</b> page to disable the build-in PDF viewer.
    You can check the value of the plugin.disable_full_page_plugin_for_types pref on the about:config page and remove the application/pdf part if present or reset the pref to the default via the right-click context menu if you want to display PDF documents in Firefox with another application (i.e. not the built-in PDF Viewer).
    See also:
    *https://support.mozilla.org/kb/view-pdf-files-firefox-without-downloading-them
    The latest stable version of the PDF Viewer (pdfjs) extension:
    *PDF Viewer: https://addons.mozilla.org/firefox/addon/pdfjs/
    Latest development version of the PDF Viewer (pdfjs) extension:
    *http://mozilla.github.io/pdf.js/extensions/firefox/pdf.js.xpi

  • Please can anybody help me. My itunes will not open on my laptop desktop.I have not changed anything on the laptop of significance.What can I do?

    Please can anybody help me? For no apparent reason or significant changes to my laptop I cannot open itunes from my desktop icon.I have uninstalled the whole product and re-installed it. But to no avail. I am very frustrated and cannot access my library or add to my ipod.Any help would be really helpful. I am on Windows7 Pro. Thank you

    Uninstall and reinstall from scratch.
    Try the following steps:
    1. Go to Microsoft website to fix install and Unistall problems. Click "Run now" from Fix it to remove all iTunes & related installer files:
    http://support.microsoft.com/mats/Program_Install_and_Uninstall
    Be aware that Windows Installer CleanUp Utility will not remove the actual program from your computer. However, it will remove the installation files so that you can start the installation, upgrade, or uninstall over.
    2. You should remove all instances of iTunes and the rest of the components listed below:
    it may be necessary to remove all traces of iTunes, QuickTime, and related software components from your computer before reinstalling iTunes.
    Use the Control Panel to uninstall iTunes and related software components in the following order:
    iTunes
    QuickTime  
    Apple Software Update  
    Apple Mobile Device Support  
    Bonjour  
    Apple Application Support (iTunes 9 or later)
    Follow the instructions from Apple article listed here: http://support.apple.com/kb/HT1923 to remove all components
    3. Reboot your computer. Next, download iTunes from here:http://www.apple.com/itunes/download/ and install from scratch

Maybe you are looking for