• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

html:checkbox element with POJO-based array not updated

 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am defining a Struts FormBean with an array of POJO objects and populating the array in an Action that presents the page with the form. When I change the values in the JSP page and submit the form, then values of the POJO are not changed, i.e. they still
hold the original values from the initial population activity instead of taking on the new values.

It seems like the Struts Framework is not calling the set methods on the POJOs. Other fields in the FormBean are indeed being updated. Below are snippets of the configuration file and the JSP page. Am I missing some step to get this to work? This is using Struts version 1.3.


In struts-config.xml file:



In JSP file:

 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was using the wrong type of HTML control, e.g. checkbox. And the POJO field was switched from boolean to String.

Also, needed modify iterate start-tag. See below:
 
permaculture is giving a gift to your future self. After reading this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic