Problem with multiple Ajax calls to the same Servlet

Hi,
I am new to AJAX. I have a requirement where in, i have to make ajax calls to the same servlet in an infinite loop and check for an application context attribute to refresh the contents in the JSP.I am using the following script in JSP. The problem is i am not able to invoke the servlet more than one time.But I am able to go through the script at specific time interval using setInterval() function of Javascript and able to get alerts.But the problem is with xmlhttp.open("Get", url, true);. Its not getting called more than one time, even though i make multiple calls to the function.
*<script type="text/javascript">*
var xmlhttp
var resp
function fAjax()
alert("Here");
xmlhttp=null;
resp=null;
// code for Mozilla, etc.
if (window.XMLHttpRequest)
xmlhttp=new XMLHttpRequest();
// code for IE
else if (window.ActiveXObject)
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
if (xmlhttp!=null)
xmlhttp.onreadystatechange=state_Change;
xmlhttp.open("GET","/PSAPBackOffice/TestServlet",true);
xmlhttp.send(null);
else
alert("Your browser does not support XMLHTTP.")
function state_Change()
// if xmlhttp shows "loaded"
if (xmlhttp.readyState==4)
// if "OK"
if (xmlhttp.status==200)
     resp=xmlhttp.responseText;
     //alert(resp);
     if (resp=="CALL"){
     form.method="GET";
     form.action="/Project/Details.jsp          
form.submit();
else
alert("Problem retrieving XML data")
function callTimer(){
     setInterval("fAjax()",5000);
*</script>*
*Code for Servlet here:*
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException
ServletContext objContext= getServletContext();
     String value;
     synchronized (objContext) {
               value=(String) objContext.getAttribute("Flag");
                    if(value==null){
                    else if(value.equals("Done")){
                         response.setContentType(CONTENT_TYPE);
                         PrintWriter out = null;
                              try {
                                   out = response.getWriter();
                              } catch (IOException e) {
                                   // TODO Auto-generated catch block
                                   e.printStackTrace();
                                                            } catch (NullPointerException npe) {
                                   // TODO Auto-generated catch block
                                   npe.printStackTrace();
                         objContext.setAttribute("Flag","No");
                         out.println("CALL");
Can someone figureout the problem or mistake and help me out.Its urgent and please help me in this regard.Thanks in Advance !

I'm not sure I'm following you. The mapping from URL to servlet can contain anything you want. So you could have the URL /blah/blah/blah that, with a mapping something like /blah/* would pass all requests with that URL pattern to your servlet - no one has to know it is a servlet. Your servlet could then parse the URL to see what it has to do or you could pass parameters as part of the URL or as hidden fields.

Similar Messages

  • Problems with multiple itunes accounts on the same computer

    Does anyone have issues with this? My husband and I have seperate iTunes accounts, and eventhough I am logged in under my username, his music is loading and mine is gone...
    Also, his iPad apps are syncing to my iTunes account - this happened just last night when I plugged my iPod in and was rearranging my playlists and his apps were syncing at the same time.

    Well, I usually think of an 'iTunes account' as being an account at the iTunes Store...  I take it you have different iTunes collections with separate library files for each of you.
    It sounds like you have different user accounts on the computer.  Figuring out what is going on will require us knowing a lot more about how you have your iTunes libraries set up.  Do you also have a shared area or do you keep totally separate accounts?  Are you positive you were't really in his account when this was happening?

  • Problems with multiple TestStand versions on the same computer

    I installed LabVIEW 2014 and TestStand 2014; then later I installed TestStand 2010 SP1 and have been using it since.  (I also updated LabVIEW 2014 to 14.0f1; I think I did that after installing TestStand 2010 SP1.)  Is this "legal?"  I have been seeing strange behavior with TestStand 2010 SP1:
    - if I type in any expression text boxes in the Sequence Editor (e.g., for a pre-expression), I periodically get an error dialog as I type:
     "The .NET support dll could not be loaded.  This is caused by an assembly path that could not be resolved.  Error Code: -18700, The .NET support dll could not be loaded.  This is caused by an assembly path that could not be resolved! Source: 'TSAPI'
    After I acknowledging the dialog, I can contine to type a little more before getting the dialog again, but it doesn't seem to invalidate anything I type.
    - If I open the Simple LabVIEW Simple User Interface that ships with TestStand 2014 while TestStand 2010 SP1 is active, LabVIEW immediately crashes.  I can open all the subVIs without a problem, but the top-level VI always crashes LabVIEW.
    So I used the TestStand Version Switcher to make TestStand 2014 active, opened the top-level Simple UI VI, and deleted all the UI controls.  Then I switched back to TestStand 2010 SP1, and then I was able to open the top-level VI.  I added back the TestStand UI controls to the VI, and now the VI runs.  But many operations return a TestStand error dialog, such as Close Execution ("Value invalid or out of range [Error Code: -17300]"), Logout ("Cannot find item to select in ComboBox [Error Code: -2147467259]"), and (critically) Exit ("Operation Failed.  Error Code: -17500]") and the X in the upper right corner of the window ("Operation Failed.  Unknown System Error in <VI name>").  So I can't exit without killing LabVIEW.
    These two issues may be unrelated.  But maybe installing an older version of TS after installing a newer version is not a valid use case?  Is the ActiveX error a result of this?  Should it be possible to use a (simple) UI written for a newer version of TestStand be able to work with an older version of TestStand?
    I have another issue that is probably unrelated, but I'll bring it up here just for completeness.  If I right-click on a LV property node or invoke node for a property or method from the TS API and ask for help for the property or method, a command window flashes briefly before showing the TS help window with the top-level item selected (i.e., it doesn't take me to the help for the selected property or method).  I have this problem with either version of TS active, and I saw this problem even before I installed TS 2010 SP1.  I seem to recall having this problem once before, but I can't find the solution.  I don't know if this problem is an indication of some other larger problem.
    For what it's worth, I am running WIndows 8.1 on a virtual machine.

    Thanks for the information, Doug.  Maybe the ActiveX error dialog I get while in the sequence editor is related to the fact that I'm running an unsupported operating system.
    So using a UI that was created in a newer version of TS is not supposed to be able to run with an older version of TS.  Is there any way to enforce this (like having a dialog appear informing you of the incompatibility when the TS engine is loaded) and avoid an immediate crash?  (Maybe the crash has to do with the incomaptible OS as well.)
    Is there a way to "relink" a UI to an older version of TestStand?  Can you just relink all the ActiveX reference controls/constants to the TS ActiveX servers?  As far as I can tell, everything I am trying to do with the new TS version should work with the old version.  And also, as far as I can tell, the TS version switcher changes the version of the available ActiveX server; so unless my UI uses a feature unavailable in older TS versions, I would think it shouldn't know the difference.  (I'm making a lot of assumptions in that last statement, so I may be totally wrong here.)
    Thanks,
    Jeff

  • How to differentiate multiple aRFC calls into the same session.

    Hi experts,
    I have following problem:
    I start multiple aRFC calls in the same remote session by using the same task ID for each call and use
    KEEPING TASK when receiving the results.
    The calls are all of the same RFM (e.g get_status of obj), just calling parameters changes ( in the generic example, the parameter: obj).
    In the receive method, I differentiate to which obj the result is related by exporting the obj_id on success of the RFM.
    My problem is when the status call fails. I just get an error message explaining what the problem is. But I don't get the exporting parameters.
    Do you have any idea how to solve this problem?
    kind regards,
           Sahla

    This is actually the workaround I made to go on.
    Actually the underlying logic in the RFM for getting the status is based on a synchronous call, as to say when you get the exception you know of which request it comes from.
    Therefore the exception messages and their parameters are well defined and according to the error situation filled with necessary data explaining the exception situation.
    Unfortunately the excpetion class used is based on the message T100 interface and has the limitations of just four message parameters and each of 50 charcter length.
    I overwrite the last message parameter with the needed obj parameter, taking the risk to overwrite valuable system responses explaining the situation.
    I thought there could be a more elegant solution from the framework itself.
    kind regards,
         Sahla

  • Problem with multiple Toplink/JPA apps in same server

    Anyone have experence of running serveral Toplink/ EJB-3 Web apps in the same server (OC4J, alas)?
    We seem to get a problem with the second app failing to initialise toplink, with an entity not found message. Each app runs OK on it's own.

    Yes, they access the same datasource and most of the tables overlap.
    We're thinking it might help to have common entity classes and put them in a shared library, but I don't know if this is relevant (setting up shared libraries complicates testing and tends to snowball, I reckon we need about 15 jars all told).
    I''ve had some funnies on OC4J before which I think may be to do with it's use of ClassLoaders, for example I initially put persistence.xml in the libary jar with the data model, but for some reason I get the entity not found error that way. It only seems to work if it's in the classes folder.
    For the moment we're getting arround the problem with multiple OC4J instances in the server.

  • Howto deal with multiple source files having the same filename...?

    Ahoi again.
    I'm currently trying to make a package for the recent version of subversive for Eclipse Ganymede and I'm almost finished.
    Some time ago the svn.connector components have been split from the official subversive distribution and have to be packed/packaged extra. And here is where my problem arises.
    The svn.connector consists (among other things) of two files which are named the same:
    http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/features/org.polarion.eclipse.team.svn.connector_2.0.3.I20080814-1500.jar
    http://www.polarion.org/projects/subversive/download/eclipse/2.0/update-site/plugins/org.polarion.eclipse.team.svn.connector_2.0.3.I20080814-1500.jar
    At the moment makepkg downloads the first one, looks at its cache, and thinks that it already has the second file, too, because it has the same name. As a result, I can neither fetch both files nor use both of them in the build()-function...
    Are there currently any mechanisms in makepkg to deal with multiple source files having the same name?
    The only solution I see at the moment would be to only include the first file in the source array, install it in the build()-function and then manually download the second one via wget and install it after that (AKA Quick & Dirty).
    But of course I would prefer a nicer solution to this problem if possible. ^^
    TIA!
    G_Syme

    Allan wrote:I think you should file a bug report asking for a way to deal with this (but I'm not sure how to fix this at the moment...)
    OK, I've filed a bug report and have also included a suggestion how to solve this problem.

  • Problem with mutiple BAPI calls during the commit

    Hi all,
    I am trying to create accounts for a given partner i the transaction F9K1 using the BAPI BAPI_BKK_ACCNT_CREATE. After calling the BAPI I am committing it too.
    The problem is if I try to create multiple accounts like RCA, ACA, MCA, IOE and so on, the first time the BAPI is called to create RCA account it is successful an it is even committing. When I call the BAPI to create the the ACA account the return table from the BAPI shows success message but the commit fails. If I restart the program and try creation of accounts now the RCA will throw a error msg saying account already exist, ACA account will be created and then the MCA account creation fails in the same manner explained above.
    I see the issue is with multiple BAPI calls and I tried using all sort of methods like clearing buffers, start new task in local and wait command and all.  But none of them seems to be working for me.
    Can anyone please guide me on how I can overcome this problem.
    Thanks.

    BAPI :
    BAPI BAPI_BKK_ACCNT_CREATE
    Functionality
    Use this method to create an account in Bank Customer Accounts. This method returns the following values:
    Identification details for the newly created account such as the internal and the external account number, and the bank area details
    A table containing error messages
    To create an account by using this method, you must specify values for the import parameters Bank Area (BANKAREA) and Product (PRODUCTNAME).
    Note: You must also specify a value in the External Account Number (EXTERNALACCOUNTNR) parameter if you have defined an external number range for the bank .
    REgards,
    Jayan.

  • Problem running multiple folder actions at the same time

    Hi,
    Does anyone have some experience running multiple folder actions at the same time?
    I've written a Applescript folder action that processes some files. When adding some files, the script starts and all goes well. The processing of each file takes a few minutes, but all files are processed correctly.
    However, when adding some new files to the dropfolder, while the folder action is all ready processing other files dropped a few minutes earlier, the process that is all ready running immediately aborts and the folder action is relaunched on the new files, leaving the old files for what they are...
    The same problem occurs with multiple folders, each having a folder action attached. When dropping files in "Folder A", the script starts processing. But if someone droppes files in "Folder B", The script of folder A aborts, and the script of folder B starts processing. When adding more files to the folders, the result is the same. In some casses, when the last dropped files are processed, the os continues where the operation was aborted on the previous files. But this not always happens. To make things worse, when you remove the items from the folders afterwords, the folder actions starts running again on items no longer present in the folder !!!!
    Does anyone know how I can prevent the folder action being aborted when new files are dropped and placing the new files in "Hold", until the previous files are processed? How can I prevent a folder action being aborted when a item is dropped into another folder?
    I've written a small script to test this behaviour. Just create one or more folders and attach the script below. Drop a item into the folder, wait a few seconds and drop another one in the same or another folder. To monitor what happens please check the console.
    on adding folder items to this_folder after receiving added_items
              set FolderName to this_folder as string
              set ItemName to added_items as string
              repeat with theIncrementValue from 1 to 15
      delay 2
                        do shell script ("logger \"Folder: " & FolderName & "  -  Item: " & ItemName & "  -  Step: " & theIncrementValue & "\"")
              end repeat
              do shell script ("logger \"Folder: " & FolderName & "  -  Item: " & ItemName & "  -  Done...\"")
    end adding folder items to
    Thanks for any feedback.

    That is pretty much the way Folder Actions work, especially since AppleScript is not multi-threaded.  If you are using them as some intermediate step in a workflow, you might rethink the way you are handling the files (for example, use a droplet instead).  Other options would be using launchd to watch a path or a shell script on a different thread.

  • Apple TV with Multiple Mac's in the same house & a PC

    Question--
    I recently got a used Apple TV for christmas. I successfully synched it with my Macbook but I haven't tried to synch the content from my iMac or PC. I'm wondering if I can synch content from two seperate mac's & my PC and not have the content from the first Mac erased. The Apple TV has a 150 GB Hard drive so I figure i can use it as a mass media storage device for all of my computers.
    So I am curious if all of my computers can play nice with my Apple TV at the same time without having content erased automatically. I would have already tried it but it takes so long to synch all of my content that I don't want to risk it especially if it doesn't work.
    What codecs does the Apple TV support? Can I put Divx and Xvid movies in my iTunes Movies folder and have them play? Or do I need to convert them to an Apple friendly file.
    Thank You

    OK
    Important things first:
    1 - there is no way (short of hacking/dismantling) AppleTV to get media off it
    2 - therefore you MUST NOT use it as a mass storage/backup device
    3 - you must keep copies of files synced (copied) to it in a single iTunes library
    4 - if you delete those files and sync again they will go from AppleTV too
    You can only sync a single library, but you can stream up to 5.
    Codecs are limited to MP4/h264, see here:
    http://www.apple.com/uk/appletv/specs.html
    Anything else needs to be converted.
    AC

  • Validate XML with multiple XML Sechme in the same namespace

    In my program, i use multiple xml schemas to validate against my xml files.
    However, i found the following code do not work because all schemas in the same namespace.
    Does any one have some solutions to validate multiple XML Schemas in the same namespace?
    Thanks~~
    static final String[] schemas = { partyInformationSchema,
    itemInformationSchema,
    exceptionsSchema,
    salesForecastSchema,
    exceptionCriteriaSchema };
    factory.setAttribute(JAXP_SCHEMA_SOURCE, schemas);

    I have used the Object arrsy too, but it didn't work.
    static final Object[] schemas = { partyInformationSchema,
    itemInformationSchema,
    exceptionsSchema,
    salesForecastSchema,
    exceptionCriteriaSchema };

  • Inbound Invoices (EDI 810) with multiple items that are the same keys.

    One of our Vendors just started sending us 810's that have multiple items with the same P.O., Delivery, P/N, Price, etc.  The reason is that they (and we) track inbound batches for the purpose of traceability, so the only difference between items on both the invoice and inbound delivery is the batch number.
    SAP will not allow the automatic creation of an SAP Invoice with these conditions.  The error message is M8321 - 'Document contains same order item more than once'.
    SAP Note 103051 says it cannot be done, and you must "Deactivate the billing of the batch sub-items in SD Customizing" in order to have an Invoice created that combines all items into one.
    Does anyone know how to do that?
    Thanks in advance!

    Nevermind. Fixed the problem. Two menu items both began with the letter S. Added an & before the second letter of the second menu item and now the problem is fixed. First items hotkey is S and the second items hotkey is now h (which is the second letter of the 2nd menu item).

  • Problem with UITableViewCell, can´t add the same custom cell

    Hi,
    I have a table view which I populate the cells with a UITableView class that i wrote. This custom class has two labels and a image view. In the method cellForRowAtIndexPath, i use the following code:
    [cell addSubview:myTableViewCellClass];
    the first cell is ok, the cell displays my custom cell. But the second cell can´t display the same custom cell object. Is there something I can do to avoid this problem?
    I have another problem. When i scroll my table view very fast, the program crashes with the following message:
    [Session started at 2008-08-24 18:30:10 -0700.]
    Loading program into debugger…
    GNU gdb 6.3.50-20050815 (Apple version gdb-960) (Sun May 18 18:38:33 UTC 2008)
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB. Type "show warranty" for details.
    This GDB was configured as "i386-apple-darwin".warning: Unable to read symbols >for
    "/System/Library/Frameworks/UIKit.framework/UIKit" (file not found).
    warning: Unable to read symbols from "UIKit" (not yet mapped into memory).
    warning: Unable to read symbols for "/System/Library/Frameworks>/CoreGraphics.framework/CoreGraphics" (file not
    found).
    warning: Unable to read symbols from "CoreGraphics" (not yet mapped into memory).
    Program loaded.
    sharedlibrary apply-load-rules all
    Attaching to program: `/Users/pitteri/Library/Application Support/iPhone
    Simulator/User/Applications/9F7BD517-CB1E-49C5-BD30-24831239120F/OndeEstou.app/O ndeEstou', process 11209.

    This is not the correct method for using custom table cells with a table. You need to create a custom cell class that extends UITableViewCell. This class should handle the layout and display for the content of a single cell.
    In your table view delegate's 'cellForRowAtIndexPath' method, you create or obtain an instance of your custom cell, configure the cell by setting the title or other properties appropriate for you custom cell, then return the cell. That's it.
    It appears, from your code, that you are trying to add the table view cell class to the cell. Maybe you mistyped. But don't call 'addSubview' on anything within the table view delegate.
    Have a look at the UICatalog example app. It has several custom table cells and shows both how to implement a custom cell, but also how to use it in a table.
    Enjoy.

  • Working with multiple user accounts on the same folio/article

    Hi,
    i have the follwing issue:
    - User A owns the folio (the one that publsihes it), the folio is shared with user B and C
    - User B is the graphics designer. He does the Artwork
    - Usee C should do the textutal corrections
    Problem:
    - User C cannot access the Articles User B has created
    Question: What is the right solution for this kind of problem? Two (or more) people should be able to work on an article using their personal account. The only solution I see at the moment is to create a specific "designer-account" per folio project that all these people share.
    Are there any other options
    cheers
    Thomas

    Thanks for the quick responses.
    The sharing of the data is not the problem, in fact, cloud storage can be one of the solutions. But regardless, if people work on different locations or in the same intranet, it can always happen, that designer B goes on holiday and there needs to be done a change on one of the articles inside the folio that B has been working on. It is a pitty, that Designer C cannot take over and do the changes without either having to have user/password of B or "destroying" the folio settings, removing the article completely and re-entering it drom scratch (with all correct settings, namings etc) what makes B having to do the same, as soon as he comes back. This might also have to do with the absolute path references used in folios instead of logical ones (every user can set as "folioroot" on his computer) what also would make the dropbox (or adobe cloud) approach work, as everybody would share the same subfile structure and could "jumpstart" working on the folio.
    Nevertheless, thanks for the answeres, things work as they do. I was just wondering if I am doing something wrong.
    We will now create shared working users per project, so everybody involved in the project will use that user.
    Thomas

  • Troubles with multiple ESLL-SRVPOS in the same outline agreement line item!

    Hi all,
    Currently have an issue where the same service master is being used multiple times in a single outline agreement line item (set up with different groups in the service specifications with different rates).
    This is causing issues with drawing services into purchase orders.
    Eg: In ME57 when creating a PO from a PR, in the include LMLSPF5J /SEARCH_SRVPOS_CONT/ the system is checking if ESLL-KNT_INTROW is empty (which in my case it is, and message SE361 is displayed).
    The main thing thats happening is that ESLL_KNT_PACKNO and ESLL_KNT_INTROW, which hold the reference data to the outline agreement in the PO should get filled with the packno and introw from the oa service line but it isnt happening.
    I'm thinking of creating a validation so that the same service service number (ESLL-SRVPOS) CANNOT be used in the same outline agreement line item.
    Wondering if anyone has had this same issue and what path they went down to resolve it.
    Any ideas would be appreciated.
    Tim

    hi
    u cannot do this because different line items cannot be in same cell as they are variable and only one field can be there ata atime in one column while creating field catalog
    <b>u can do one thing. corresponding to sales order u can display its line items ion the secondary list and would make more sense also. for this make ur sales order number as HOTPOT on click of which will display its corres line items </b>
    regards
    ravish
    <b>reward if useful</b>
    Message was edited by:
            ravish goyal

  • Problems with interlaced and progressive on the same timeline ?

    Is there any problem with having both interlaced and progressive on the same timetine ? EG will DVD work OK?
    thanks
    Narada

    Hey Narada,
    I've had projects where I used both and DVD worked just fine. The only thing I'm not sure about now, though, is what I had my field dominance set to. I'm pretty sure it was set to the default so either lower or higher. This leads me to ask the old pros around here a second question:
    What happens to progressive video that's placed in a timeline with a field dominance? Is it no longer treated as progressive?
    Anyway, to answer your question my DVDs worked just fine.
    Hope that helps,
    Cameron

Maybe you are looking for

  • Server 2012 cluster - virtual machine live migration does not work

    Hi, We have a hyper-v cluster with two nodes running Windows Server 2012. All the configurations are identical. When I try to make a Live migration from one node to the other I get an error message saying: Live migration of 'Virtual Machine XXXXXX' f

  • Workflow Message - "Update Was Terminated" while MIRO

    Hi Experts, Please help me in the following  - Requirement : Whenever Invoice (by MIRO) is blocked either due to Price or Amount, a mail should be triggered to a user in his SAP Inbox. Approach : Business Object used - BUS2081.                  Event

  • Button not Displaying in JRE 1.4.2

    We have one Applet with Image button and it used to work fine with JRE 1.4.1. If I install JRE 1.4.2 in my Machine Image Buttons are not displaying. We coded as follows public class ImageButton extends JButton { private Image image = null ; private A

  • PL/SQL AQ notification works in XE but not in our Enterprise Edition

    Hello, I am trying to get a Queue up and working and have ran through several examples, but I cannot get the Notify to work in our development environment but it works just fine in my local XE instance. Below is the code that WORKS in XE but does not

  • ADDING THE NEW TAB TO PERSANALIZATION IN LEFT PANEL OF BCC

    Hi guys I am trying to add a new item to persanalization . and i created genericActive.xml taskConfiguratin.xml orderviewConfigaration.properties and the headline is coming in panel but content of the order table are not replecting it showing followi