Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java object is not rendered in jsp using json and spring framework.  RSS feed

 
kv kiran
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm new to Json framework. I'm unable to display response from the server. where as my client is hitting the controller method.

please find the jar file details that I'm using in the spring mvc.
spring-beans-4.0.6.jar
spring-webmvc-4.0.6.jar
jackson-core.2.2.3.jar
jackson-core-asl.1.9.7.jar
jackson-databid.2.4.3.jar
jackson-mapper-asl.1.9.12.jar



Here is the html snippet and jquery code


When I tried to hit findAgents.html in the browser it is hitting controller method sucessfully and I'm getting the 406 error as shown below.
The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers ().

Request to help me in making this code to work.

Thanks & Regards,
Kiran
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37180
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kiran,
Your Java method is returning a list rather than a JSON String. This code example shows one way to do that with Jackson.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!