Results 1 to 2 of 2
  1. #1
    MaheshReddy is offline Member
    Join Date
    Sep 2009
    Rep Power

    Question JSP - AJAX problem


    I am doing an AJAX call from my JSP and i am getting the response too.
    But after getting the response, i am not able to do anything in the page. Mouse pointer is keep on showing busy symbol.
    Did anyone of you faced this kind of problem? Please let me know.


  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Rep Power


    Not sure I follow, are you using a JSP page to render the AJAX response, or having a JSP page render the HTML,and javascript that invokes the AJAX call (to another JSP or servelt).

    usually it's possible to bake a URL with the GET parameters in firefox, or use the Commons-http client to create a Java JUnit test case to invoke a POST request to your server, so as to verify the JSP / servlet that is the handler for the AJAX operation is receiving the request, doing its thing, and returning the expected response properly. Sometimes for example, a server-side AJAX handler can do something that gets stuck in an infinite loop, or attempts to do a redirect if not logged in (or if the session has expired). Other times, it could be just returning a response slightly different from what is expected of the Javascript (like bad JSON or something). So verifying the server-side AJAX piece works on its own is a good sanity check.

    After that, when the server-side request/response is working, its possible the javascript xmlhttprequest function is just not invoking the handler function when the response completes. There could be a javascript error that causes an infinite loop. If possible, try using a modern firefox browser with the livehttp headers, and the FireBug plugins. this allows you to see a javascript console, which will show any javascript errors if there are any. it also will let you inspect all network operations, such as to see the actual ajax request and the response. It could be the request is just not passing in all the required paramterrs. Or possibly the JSP page is not setting the response content-type HTTP header, such as to say the response type is text/javascript, or text/json. Some Javascript frameworks might misbehave if the ajax response content-type is not properly set.

Similar Threads

  1. Jsp with Ajax
    By sundarjothi in forum JavaServer Pages (JSP) and JSTL
    Replies: 16
    Last Post: 09-25-2008, 11:29 AM
  2. AJAX in JSP
    By haiforhussain in forum JavaServer Pages (JSP) and JSTL
    Replies: 8
    Last Post: 07-01-2008, 03:12 PM
  3. Example for Ajax-JSP
    By smrithi in forum JavaServer Pages (JSP) and JSTL
    Replies: 8
    Last Post: 06-02-2008, 03:00 PM
  4. Problem reading an xml file with AJAX
    By Fiona80 in forum XML
    Replies: 0
    Last Post: 12-17-2007, 09:02 PM

Tags for this Thread

Posting Permissions

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