Matt RaibleMatt Raible is a Web Developer and Java Champion. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

ConvertUtils and Indexed Properties

Now I have a new issue with ConvertUtils. I've resorted to creating a Form, rather than generating one from a POJO using XDoclet. In this form, I've added indexed properties, so that properties can be accessed and retrieved with an index.

So now I have getPropertyList() and setPropertyList(ArrayList) on my form. I also have getPropertyList(int index) and setPropertyList(int index, Property prop). However, when I add these methods, my ListConverter.convert method quits working! So now when I call:

BeanUtils.copyProperties(cmcfForm, c);

it returns null for the ArrayLists on my form? I don't get why, esp. since the methods have different signatures. It works fine if I remove the indexed methods.

Update: I solved my problem by removing the getPropertyList(int index) method. I had to add some funky stuff in the reset method of my Form to ready it for Struts auto-population, but it works. Specifically, I had to create an ArrayList for my child, and then populate it with empty child forms. This allowed setPropertyList(int index, Property prop) to work as expected. FYI - I don't think this is a Struts thing, but how webapps work. Anyway, I'm happy with how this works - as I know have indexed properties working for display and saving. Now I have to figure out saving parents/child in Hibernate (I've done it with struts-resume and MySQL, just not with Oracle). I've posted my problem to the Hibernate mailing list if you're really interested in my problem.

Next up, indexed property validation using the Validator. Should be oh so fun...

Posted in Java at Jan 16 2003, 11:03:31 AM MST Add a Comment
Comments:

Post a Comment:
  • HTML Syntax: Allowed