Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7498309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:25:45+00:00 2026-05-29T19:25:45+00:00

Using Jackson I can able to convert the object to JSON @RequestMapping(value=getMessage.test, headers =

  • 0

Using Jackson I can able to convert the object to JSON

@RequestMapping(value="getMessage.test", headers = "Accept=application/json" ,method = RequestMethod.POST)
    public @ResponseBody TestObject getMessage(){
        TestObject object=new TestObject();
        object.setMessage("Hello JQuery");
        return object;
    }

The above code works well… But conversion from JSON to Object gives WARN PageNotFound – No matching handler method found for servlet request: path ‘/setMessage.test’, method ‘POST’, parameters map[[empty]] Below is the code. Where i am going wrong..

@RequestMapping(value="setMessage.test", method = RequestMethod.POST, headers = "Accept=application/json"  )
    public void setMessage(@RequestBody TestObject test,HttpServletRequest request){
        System.out.println("Inside setting message");
        System.out.println(test.getMessage());
    }

JQuery Ajax calls…

 $.ajaxSetup({   contentType: "application/json; charset=UTF-8" }); 

    $.post('getMessage.test',function(response) {  
        alert(response.message);
           }, 'json');  

    $.post( 'setMessage.test', {message: 'Hello Spring'});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T19:25:45+00:00Added an answer on May 29, 2026 at 7:25 pm

    Finally i got the fix. There is a bug in JQuery $.post method which is not setting the proper contenttype. So setting the contenttyple in the ajaxsetup works well… and i used jquery.json-2.3.min.js to create a json object…..

    $.ajaxSetup({   
               contentType: "application/json; charset=UTF-8"
        }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using jackson to convert an object of mine to json. The object has
I am using JSON Jackson to convert from POJOs to JSON. I am using
I'm trying to display the following JSON object using YUI DataTable. I was able
How can I receive the node names from a JSON tree using Jackson? The
I am serializing and deserializing following domain object to JSON using Jackson 1.8.3 public
I'm having trouble getting Jackson to correctly deserialize json into an object when calling
Can I use Jackson instead of JSON-lib with Groovy's HTTPBuilder when setting the body
I am using spring android rest template and trying to convert a JSON response
I am using Jackson 1.8.3 in a Spring application to map Java Objects to
I'm trying to use Jackson to deserialize some JSON originally created using Jackson. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.