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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:34:42+00:00 2026-06-13T04:34:42+00:00

Trying to bind a field to a map of objects I got this error

  • 0

Trying to bind a field to a map of objects I got this error
“*[NullValueInNestedPathException: Invalid property ‘wrappedText[index]’ of bean class [models.Simple]: Could not determine property type for auto-growing a default value]

From what I’ve read the autogrow has to do with attempting to populate the Map on the fly..but that’s about as much as i’ve gotten..

I also came across this question which asks virtually the same question but in the context of Spring MVC ,I see that the accepted answer seems to be suggesting that the OP implement their own map
what is the reasoning behind this and is there an alternative?

Models:

public class Simple {

  public String text;
  public List<String> stringList;
  public TreeMap<String,SimpleWrapper> wrappedText=new TreeMap<String,SimpleWrapper>();
}

…

public  class SimpleWrapper {

    String singleString;

    public void setSingleString(String singleString){
      this.singleString=singleString;
    }
    public String getSingleString(){
      return singleString;
    }
    public SimpleWrapper(){
      this.singleString=singleString;
    }

Controller

static Form<Simple> simpleform=form(Simple.class);
public static Result simpleForm(){

    Form<Simple> filledForm=simpleform.bindFromRequest();
    System.out.println(filledForm);

    return ok(views.html.simpleForm.render(filledForm.get().toString()));
}

View

@(text:String)
@import helper._

@form(routes.Management.simpleForm()){
<input type="hidden" value="string" name="stringList[0]">
<input type="hidden" value="string Again" name="stringList[1]">
<input type="hidden" value="mapp value" name="wrappedText[index].singleString">
<input type="text" id="text" name="text">
<input type="submit" value="submit">
}

This was passed @text

  • 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-13T04:34:43+00:00Added an answer on June 13, 2026 at 4:34 am

    Ok so I guess I misunderstood the answer to the other Question.I did not have to implement a LazyMap since the guys at apache-commons have already done that.

    I ended up modifying my model to this:

    Model

    import org.apache.commons.collections15.Factory;
    import org.apache.commons.collections15.map.LazySortedMap;
    
    
    public class Simple {
       public String text;
       public List<String> stringList;
       Factory<SimpleWrapper> factory = new Factory() {
           public SimpleWrapper create() {
              return new SimpleWrapper();
           }
       };
    
       public Map<String,SimpleWrapper> wrappedText =LazySortedMap.decorate(new TreeMap<String,SimpleWrapper>(),factory);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to bind a JTextField to a bean's field that is a
I'm trying to bind an xp:inputRichText to a bean (ChatBean), but get this validation
Im trying to bind a list with datetime objects to my repeater. if (e.Item.ItemType
I've been trying to map a clob field using Fluent NHibernate 1.2.0.712 against Oracle
I'm trying to bind anchor attributes to a KnockoutJS ViewModel field. I tried something
I am trying to bind a field of the primitive type int to an
I'm trying to bind a field to my coverter... But it seems like it's
I'm trying bind a GridView Column to a List element at a fixed index,
I am trying to create subclasses from the default field classes of wtforms. class
Hi I am trying to bind a SQL XML field to my gridview. 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.