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 8396313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:30:19+00:00 2026-06-09T20:30:19+00:00

I have a JSON format of var array1 = new Array; var array2 =

  • 0

I have a JSON format of

var array1 = new Array;
var array2 = new Array;
//push some string to array1 and array2
var data = JSON.stringify({'email':email,'age':age,'array1':array1,'array2':array2});

How could I map it to POJOs using Jackson JSON Mapper to avoid 400 Bad Request.

I have tried

public class MyPOJOs{
  private String email;
  private String age;
  private MyList array1;
  private MyList array2;
  //getters and setters
}
public class MyList{
  private ArrayList  list;
  //getter and setter
}

My controller

public @ResponseBody Response myController(@RequestBody MyPOJOs myPOJOs){
   String email = myPOJOs.getEmail();
   logger.log("Hi " + email);
   return null;
}

Thanks.

  • 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-06-09T20:30:21+00:00Added an answer on June 9, 2026 at 8:30 pm

    I do not really know Jackson JSON processor but I would be surprised that it is able to map your arrays to your custom MyList objects.

    I would expect the MyPOJOs class to have member like private String[] array1 or private List<String> array1 or a Collection.

    btw: There are many mistakes in your code that make me think you do not post real code here. Misspelled type names etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dynamic json data having the format var cols= { columns :
In controller code, I have data in json format data = { 1: {assetId:1,status:true},
I have an application which obtains data in JSON format from one of our
I have a text file that contains cached data in JSON format. I'm trying
I have 3 json arrays, each with information listed in the same format: Array:
I have a requirement where i need to loop through JSON Format data and
I have a file with data in the json format. The data is odd
I want to send some data in json format to php and do some
I have file in json format of world-countries I want to change it to
I have a configuration file in the following JSON format: { key1: value1, key2:

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.