Hi, I bet this issue has to do with the client not sending the proper Accepts header info and the rest resource does not see it as appropriate. Apparently jQuery is not doing the 'right thing'. I recently had this issue. My working example of a jQuery function for a conditional get looks like:
conditionalGet: function(contentType, path, options, success) { var accepts = {} , headers = {}; switch(contentType) { case "html": accepts.html = "text/html"; headers["Accept"] = "text/html; charset=utf-8"; headers["Content-Type"] = "text/html; charset=utf-8"; break; case "xml": accepts.xml = "application/xml"; accepts.text = "text/xml"; headers["Accept"] = "application/xml; charset=utf-8"; headers["Content-Type"] = "application/xml; charset=utf-8"; break; case "json": accepts.json = "application/json"; accepts.text = "text/plain"; headers["Accept"] = "application/xhtml+xml; charset=utf-8"; headers["Content-Type"] = "application/xhtml+xml; charset=utf-8"; break; } var ajaxOptions = { accepts: accepts , headers: headers , cache: true , dataType: 'xml' , error: function(jqXHR, textStatus, errorThrown) { console.error('jqXHR: ', jqXHR); console.error('textStatus: ', textStatus); console.error('errorThrown: ', errorThrown); } , ifModified: true , statusCode: { 404: function() { alert('The requested file was not found at: \n\n' + path); } ,304: function() { //console.log('Getting from cache...'); success(_cache[path]); } } , success: function(data, textStatus, jqXHR) { if (data !== undefined) { _cache[path] = data; success(data); } } , url: path }; $.extend(true, ajaxOptions, options); $.ajax(ajaxOptions); } On Mon, Mar 26, 2012 at 10:00 AM, Christopher Schultz <ch...@christopherschultz.net> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Serdyn, > > On 3/23/12 11:26 AM, Serdyn du Toit wrote: >> The client code was first in Jersey (jersey.java.net), then written >> in plain Java, and then using Apache HttpComponents >> (hc.apache.org). All versions of client code hanged. > > Could you try using this little utility I wrote? > > http://www.christopherschultz.net/projects/java/URLFetch.java > > Let me know if that works. If it fails, please send me a thread dump > of the hung process and a wireshark dump of the HTTP conversation. > > Thanks, > - -chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG/MacGPG2 v2.0.17 (Darwin) > Comment: GPGTools - http://gpgtools.org > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk9woLwACgkQ9CaO5/Lv0PDA8QCeNTcwtbt3pIODkAWcfNKL69jl > 5hMAn1nBooVh7gepdGVsuioqP39OqPMt > =uq8o > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org