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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:27:50+00:00 2026-05-26T14:27:50+00:00

I have 2 class like below, public class CheckInBean implements Serializable{ private String user;

  • 0

I have 2 class like below,

public class CheckInBean implements Serializable{

private String user;
private Date checkInDate;
private List<ItemBean> items;


..followed by getters and setters

public class ItemBean implements Serializable{

private static final long serialVersionUID = 1L;

private int itemId;
private String barcode;
private String description;
private int minimalCount;
private int initialCount;
private int actualCount;
private String location;

    ... followed by getters and setters

I have a jsp page using spring form tags.

I need to enter date and multiple ItemBean values (more than one on the same page) for List. I m not sure how to do it with i just read somewhere in stackoverflow to use Propertyeditor , but i m not sure if it suits my requirement. Please suggest.

I m using Spring 3.

Thanx

  • 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-26T14:27:51+00:00Added an answer on May 26, 2026 at 2:27 pm

    Well, what happends there is that if you submit your form with data for one or more ItemBeans, Spring MVC will try to map those values to EXISTING ItemBean entities. If your list of ItemBeans inside CheckInBean instance is null/empty Spring MVC will throw an error. There’s multiple things you can do to prevent this:

    • Make your own implementation of java.util.List (you can override ArrayList for example) and change the get(int position) method such that when it’s called for a certain position and normally that position would return null, you first make a new instance, place it at that position in the (super) List and then return it. This is kind of a hack but it’s good if you can have a large interval of ItemBean instances (like you might need 3 or you might need 400), as it will only create the needed instances and not over-pollute the memory.

    • You can prepopulate the list of ItemBeans inside CheckInBean with a predefined number of empty items which is the maximum number of ItemBean instances that the user can add to that bean using your form. This is less of a hack than the above option, but it tends to be wasteful memory-wise. It would be ok if you have a small maximum number of ItemBeans that can be added to CheckInBean .

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

Sidebar

Related Questions

i have a class like below public class Foo<T> { public List<T> Items{ get;
i have class like below class Person { public string Name{get;set;} public string Surname{get;set;}
I have a test like below: public class TestSizeAnnotation { public static void main(String[]
I have a template class like below. template<int S> class A { private: char
I have a class like this: public class myClass { public List<myOtherClass> anewlist =
I have a class like this: class MyClass{ public: MyClass(int Mode); private: std::map <
I have a class like this public class foo { private void getThread() {
I have a class like this: public class Contest { List<ContestTeam> Teams { get;
I have a class that has an instance property on it like below Public
I have an interface like below public interface FooDAO { public void callA(String x);

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.