0

In Spring MVC 4 controller i am getting in capital letter

{ "Result":"OK", 
"Records":[ ....... ]}
which is requred for Jquery Jtable but when it reaches js it is converting to
 { "result":"OK",
 "records":[ ....... ]} 

and a blank alert message popup. I am using below json dependency with spring mvc 4.0.1.RELEASE , Hibernate 4.2.1-Final

org.codehaus.jackson jackson-mapper-asl 1.9.13 com.fasterxml.jackson.core jackson-core 2.4.1 com.fasterxml.jackson.core jackson-databind 2.4.1.1

Please let me know if any one have any solution and why it is converting into lowercase automatically?

Raju G
  • 36
  • 7

1 Answers1

0

Finally I found the solution for this issue. just remove this from pom.xml

Remove

       <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.9.13</version>
        </dependency> 

Use below dependencies in pom.xml

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.4.1</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.4.1.1</version>
        </dependency>

and change the jackson property(import org.codehaus.jackson.annotate.JsonProperty) to fasterxml property( import com.fasterxml.jackson.annotation.JsonProperty) in your classes. I hope this may be useful sor some one. below post will also help

Spring 4.1.1 RELEASE and @ResponseBody return HTTP 406

Community
  • 1
  • 1
Raju G
  • 36
  • 7