Pass JSON Map Spring MVC Controller AngularJS

Pass JSON Map Spring MVC Controller AngularJS

In this sample we will use AngularJS post to pass JSON data map to Spring MVC controller and fetch all its value return back same data in response:

  • Maven project structure:

Pass JSON Map Spring MVC Controller AngularJS

  • It is very important to include jackson jars in your classpath. Below is pom.xml that shows all jackson dependencies:

  • SpringMVCController.java:

  • AngularJSFormSubmit page:

  • Output:

Pass JSON Map Spring MVC Controller AngularJS Pass JSON Map Spring MVC Controller AngularJS

download  Download Project: SpringMVCJSON

7 thoughts on “Pass JSON Map Spring MVC Controller AngularJS

  1. Hi,
    Thanks for this tutorial, I tried to download the source code, but could not open the 7z file, please your help is appreciated, can you post it as a zip file ?
    thanks.

  2. Hi Java Honk,

    When i tried above code , it gave
    Exception Details:{“data”:””}

    Plz could you help on this

    • It is very important to include jackson jars in your classpath. Have you added it? Please check your pom.xml if you all dependencies added as mentioned in tutorial. Please let me if still not working.

  3. I also have the same exception. ie) Exception :”data…”. I added the jars but it not working.

  4. I downloaded the code and deployed in server. I am getting below issue.
    java.io.FileNotFoundException: SRVE0190E: File not found :/PostFormDataByMap
    Could you please help me.

    • I believe dispatcher-servlet.xml and web.xml is properly copied. Please download the code from the link and check if both are matching. If you are using maven please copy pom.xml from tutorial.

Leave a Reply

Your email address will not be published. Required fields are marked *