This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using JQuery with Spring 3

 
John Eric Hamacher
Ranch Hand
Posts: 230
  • 0
  • 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
 
Josh Long
author
Greenhorn
Posts: 24
Linux Spring Tomcat Server
  • 0
  • 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)
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic