Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

using JQuery with Spring 3

 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spring 3.0.5
jQuery 1.5.2

Hello:

I have been trying to make an ajax call with jQuery:


My controller:


I followed the example at http://blog.springsource.com/2010/01/25/ajax-simplifications-in-spring-3-0/ but I'm missing something. The communication gets lost sometime in the response . . . the callback never fires.

Can somebody give me a hint?

Thanks
Eric
 
author
Posts: 24
5
Spring Tomcat Server Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would try making the equivalent request without ajax to see if it caused an error and hence prevented the output from being delivered. One way to test web-service calls (well, besides regular GET requests) is to use Firefox' POSTER plugin (https://addons.mozilla.org/en-us/firefox/addon/poster/). Additionally, give jquery a chance to notify you of the error with an error callback (see http://stackoverflow.com/questions/1740218/error-handling-in-getjson-calls for information on that)
 
Marshal
Posts: 67430
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Page-relative URLs are always suspect and fragile.
 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I get a 406 response "Not Acceptable". I'm looking into that now . . . .
 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can't solve this 406 . . . added "headers" to @RequestMapping



I put the Jackson jar in my classpath as was recommended.

 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I figured it out. There are two Jackson jars, core and mapper. You need both in your classpath.


Thanks for the help!

Eric
 
    Bookmark Topic Watch Topic
  • New Topic