Make a servlet wait for  a resource and respond based on the resource

Hi,
In my web application, my javascript code sends a request to a servlet for an image .
In the server side, my servlet checks whether the image exists in a particular path, if it exists it sends the image
as a response, else will wait in an infinite loop for the image. Once the image is available, it will exit the loop and will proceed further.
Is my logic to put an infinite loop right .
kindly provide me an alternative method if my logic is wrong.

Your request may simply time out.
Alternatively you can consider kicking off the image processing in the backend on first request and send a response back to the browser that would cause the browser to resend the request every 'x' seconds. You can achieve this by setting a metarefresh tag in your header or anyschronous javascript.
ram.

Similar Messages

  • Can't open iphoto in airbook. Asking to upgrade then says must rebuild library then warning about missing files. When click rebuild all I get is continued- waiting for iphoto library- and, never rebuilds

    can't open iphoto in airbook. Asking to upgrade then says must rebuild library then warning about missing files. When click rebuild all I get is continued- waiting for iphoto library- and, never rebuilds

    -1.The photo library needs to be upgraded to work with this version of iPhoto.
    Your photo library will not be readable by previous versions of iPhoto after the upgrade. The upgrade process for very large libraries may take an hour or more to complete.
    2. iPhoto is unable to open this library.
    The library has issues that require rebuilding to correct
    3. Warning
    Would you like to rebuild the library "iPhoto Library"? 
    The library "iPhoto Library" is missing required database files and must be rebuilt before it can be opened.
    4. Waiting for iPhoto library
    iPhoto will open as soon as the iPhoto library is available
    Time Machine might be backing it up

  • Time out occurred while waiting for memory resources

    Team,
    I am have Microsoft SQL Server 2008 SP1( 10.0.2734.0) 64bit with application being SCCM 2007
    I am getting below error in SQL error log ::
    Error 8645: Severity 17, state 1
    A time out occurred while waiting for memory resources to execute the query in resource pool ‘internal’. Re-run the query.
    At first glance, i thought that it is issue of query not getting enough memory.
    Searched on google but could not get way to resolve it or issue creating factor.
    Chetan

    Well,
    Upgrade is what client is not willing to go for as of now.
    They have rebooted the server and as of now, their SCCM application is working fine ( Not sure how reboot has solve the issue). We are not getting the above mentioned error also in SQL Log.
    Looks like, rebooting server has cleared the memory jam.
    Chetan
    Restarting sql server service cleared buffer cache and any such query holding or requesting more memory so issue disappeared.  You just delayed the issue not solved it. Next time dont reboot find out the cause . If you want to check whether your SQL
    Server requires more memory have a look at below counters in link
    http://social.technet.microsoft.com/wiki/contents/articles/22316.sql-server-memory-and-troubleshooting.aspx#How_to_test_that_your_SQL_server_is_facing_memory_crunch
    If your say to business about what are drawbacks on running unsupported version I am sure they will apply SP3. There are loads of fixes and its quite possible your error may be related to any such fixed issue.
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • I have snow leopard, 10.6.8 on my mac pro.  would it make sense to wait for mountain lion in the summer vice upgrading to Lion then mountaion lion?

    i have snow leopard, 10.6.8 on my mac pro.  would it make sense to wait for mountain lion in the summer vice upgrading to Lion then mountaion lion?

    Nobody can tell you that.  We don't yet know what the pricing will be or what kind of compatibility issues may arise.  If you don't need anything in Lion right now, you can certainly wait, and if you do find the features of Lion compelling, there's no reason to wait for 6 months.  Buy what you need when you need it, and don't worry so much about what's ahead...  there's always something new coming soon!

  • I have an iphone 5s and when I make a playlist on itunes for music videos and sync my iphone the playlist does not show up. What can I do to fix the problem?

    I have an iphone 5s and when I make a playlist on itunes for music videos and sync my iphone the playlist does not show up. What can I do to fix the problem?

    Version 11.1.5.5 of iTunes was just released today. If you update to that, does that help with the recognition troubles?
    http://www.apple.com/itunes/download/

  • During an app update it froze and has said waiting for 2 days and I am unable to open or delete

    During an app update it froze and has said waiting for 2 days and I am unable to open or delete. How do I recover my app?

    Try this  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased. http://support.apple.com/kb/ht1430
    iOS 7: Help with how to fix a crashing app on iPhone, iPad (Mini), and iPod Touch
    http://teachmeios.com/help-with-how-to-fix-a-crashing-app-on-iphone-ipad-mini-an d-ipod-touch/
    Troubleshooting apps purchased from the App Store
    http://support.apple.com/kb/TS1702
    Delete the app and redownload.
    Downloading Past Purchases from the iTunes Store, App Store and iBooks Store
    http://support.apple.com/kb/ht2519
     Cheers, Tom 

  • HT201210 My iPhone has crashed and i went to iTunes to restore it and after waiting for it to be restored it said "The iPhone could not be restored. An unknown error occurred (2006). Can anybody please help suggest what i should do now?

    My iPhone has crashed and i went to iTunes to restore it and after waiting for it to be restored it said "The iPhone could not be restored. An unknown error occurred (2006). Can anybody please help suggest what i should do now?

    This error normally appears if you attempted to downgrade or modify your iOS. See here http://support.apple.com/kb/TS3694#error1015

  • Wait for a file and start execute a scenario process

    What is the best way to achive: Wait for a file and then once the file in droped...execute a scenario process.
    Sample scenario:
    - Admin user ftp the file to a target directory on Unix (export/home/odi/input/files)
    - A scheduled scenario package will be running/scheduled daily
    - In the above scenario, The first step is to have one OdiFileWait (with options: Dir:/export/home/odi/input/files, File: xxxxx.txt,wait time and loop over..etc)
    /* But for some reason OdiFileWait is not waiting/checking for the file presence define in the option. It seems to run immediately without checking the presence of the file and passing it to run the second step) */
    - The second step is the "OdiStartScen" (This will run an interface generated scenario) and since the file doesn't exist as a source to load that this interface uses...its fails.
    What's the common practice to accomplish this? Appreciate your feedbacks…
    Thank you

    Update:
    I increased the timeout and Pollint setting in OdiFileWait option and its working fine now.
    When the file exists (or) ftp within the timeout the process goes to next step (OK). But, say the file doesn't exists and the timeout finished...how do i set a KO to OdiFileWait and stop/complete by existing at that step itself with out failure.

  • When I change the time zone of the clock, the "Date created" time information for my documents and image files in the Finder window (and in Get Info) is changed. Can I make the time info in "Date created" remain fixed regardless of the clock's timezone?

    When I change the time zone of the clock, the "Date created" time information for my documents and image files in the Finder window (and in Get Info) is changed. Can I make the time info in "Date created" remain fixed regardless of the clock's timezone?

    When I change the time zone of the clock, the "Date created" time information for my documents and image files in the Finder window (and in Get Info) is changed. Can I make the time info in "Date created" remain fixed regardless of the clock's timezone?

  • Possible to make an item editable for certain users and read only for other

    Is it possible to make an item editable for certain users and read only for others?
    I've been able to accomplish this by taken the select statement that I used to define an authorization scheme, placing it in the Read Only condition of the item. However, I would like to simply reference the authorization scheme to utilize caching, and to help keep things cleaner for future maintenance.
    Is it possible to reference an authorization scheme in an item condition similar to the way another item can be referenced by preceding it with a colon (i.e. :P1_First_Name)?

    Thank you, your suggestion worked.
    It would be nice on a future release of APEX if a drop-down box existed under the Ready Only section that would allow an existing Authorization Scheme to be selected or negated when applying the Read Only attribute to a form item.

  • Why do I get a black screen telling me to wait for 40 seconds and then to 'skip ad'?

    I installed a Firefox update and since then, when I try to connect to a website, I almost always get a black screen telling me to wait for 40 seconds and then to 'skip ad'. This is very irritating and a waste of time. There are no ads to skip. Why is this happening and how can I stop it?

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    You can check the connection settings.
    *Firefox > Preferences > Advanced > Network : Connection > Settings
    *https://support.mozilla.org/kb/Options+window+-+Advanced+panel
    If you do not need to use a proxy to connect to internet then try to select "No Proxy" if "Use the system proxy settings" or one of the others do not work properly.
    See "Firefox connection settings":
    *https://support.mozilla.org/kb/Firefox+cannot+load+websites+but+other+programs+can

  • Waits occur in CGS wait for IPC msg and ksxr poll remote instance

    Hi,
    i have faced thousands of wait events occur in "ksxr poll remote instance" and "CGS wait for IPC msg" and same number of waitevent timedout also.
    Anybody help me to understand what this wait event says and any relations between this two wait event.
    If this could cause any problem for my database.
    Thanks in advance

    Hi,
    i have faced thousands of wait events occur in "ksxr poll remote instance" and "CGS wait for IPC msg" and same number of waitevent timedout also.
    Anybody help me to understand what this wait event says and any relations between this two wait event.
    If this could cause any problem for my database.
    Thanks in advance

  • Apple TV stuck in restore in iTunes - message, "waiting for apple TV" and then nothing happens for hours.

    Hello having major issue with Apple TV, have searched the forums over the last week but can't find a solution that works.
    My ATV is not working when I had it  plugged into TV so I thought I would plug it in and restore it via iTunes. I have tried three different micro-USB (all of which work on other devices). So in iTunes I had downloaded the latest ATV software and it starts to restore the ATV (extracts/prepares/verifies) but the restore gets stuck on the part of "waiting for Apple TV" and then nothing happens, as in overnight nothing happens. I have tried using the remote to reset the ATV but nothing. The flashing light is constant.
    Anyone got an ideas on what to do when the restore doesn't work?

    Best to take it to Apple

  • I can not pair my itouch with my mac book pro version 10.6.6 .. it seems that maybe my itouch is having trouble connecting as my mac seems to pair, then waits for my itouch and it never works. please help!!

    can not pair my itouch with my mac book pro version 10.6.6 .. it seems that maybe my itouch is having trouble connecting as my mac seems to pair, then waits for my itouch and it never works. please help!!

    I am not certain this will fix your problem but I suggest you assign the printer a static IP address.
    Using the printer's front panel, select Menu > Network > WLAN > TCP/IP > Boot method, and change it to "static". Provide a static IP address that is on your LAN's subnet.
    For example, if you are using an AirPort Extreme, you might give it an IP address of 10.0.1.100. If you are using a Netgear or Linksys router that defaults to issuing 192.168.x.x addresses, you might give it an address of 192.168.1.100. That way, the printer will always "reside at the same address" on your network. If your router has the ability, you should reserve that address so that the router does not attempt to assign it to another DHCP device.
    Then, go to System Preferences > Print & Scan, and delete your existing printer with the "–" (minus) button. Add it again, using the "+" (plus) button. In the window that appears, select the IP pane, and from the Protocol menu select "Line Printer Daemon (LPD)". In the Address field type the IP address you gave your printer.
    If all goes well the "Pring Using" field will detect the printer at that address and automatically select the appropriate driver. You will see something similar to the following screenshot ("name" can be whatever you decide, and "location" is optional):
    Click Add, then you can close System Preferences.
    There are other possible reasons your printer is "not responding" which could include wireless interference from competing wireless networks, but try this "static IP" method first. It should mitigate the problem.

  • HT4623 I have an ipad mini.  When I tried to update my apps many of them have been showing a "waiting" message for two days and I cannot open the app or delete the app.  Any ideas?

    I have an ipad mini.  I did an app update and now many of them have been showing a "waiting" message for two days and I cannot open the app or
    delete the app.  Any ideas?

    Double tap the Home button to bring up the multi-tasking bar...tap & hold any app until they all start to wiggle...tap the red minus sign to remove every app shown. Tap the Home button when finished. Try to delete the app now.

Maybe you are looking for

  • Give me a way to count the number of entries in a  Database Table

    Hello All, I am writing a code to determine the number of  entries in a SAP/Custom table. Can you please suggest a proper approach and a good query. Thanks in advance.

  • [SAP XI] EDI orders posting job to SAP R/3

    Hi everyone! I would like to know if SAP XI has the capability to directly post EDI orders in SAP R/3 wherein IDocs are placed. If yes, how? (Please describe the process in detail) In normal EDI implementation (AI, 3rd party translator used), batchjo

  • ITunes upgrade then cannot locate source file

    It seems everytime I update my iTunes it loses the source location of my music.  I have an external drive that has over 16k music files.  I don't understand why.  At least I checked after the update before I started adding more tunes. I recall this h

  • Hi, odd error in my code with a draw circle method

    Hey, I am a first year computer science student who uses java in class. We have recently been playing with guis I have created code that when it runs it draws random circles with random gradiants. However, the code will sometimes draw a random square

  • Browser upload window too large

    After downloading Yosemite, the drop down window that comes open when uploading files for emails or imessage is now so large that I can't see the Open or Cancel buttons.  How do I resize this?