• 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

Stopping BeanUtils.populate

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy.

I have two forms which both have a property called "dg" and I'm getting an error (javax.servlet.ServletException: BeanUtils.populate) when I go from one form to the other.

If I rename the property in the second form to something else (like "poDg") then it works just fine.

I'm no struts expert, but I think the BeanUtils is trying to populate the second form's "dg" property because it has the same name as the first form. Unfortunetly, I need to use the name "dg" because it is used extensively in a tile which is used frequently.

How can I prevent Struts from trying to auto-populate my second form?

Edit: I can work around it by having the name different and passing the new name as a parameter when I'm importing the tile (then using the Tile:getAsString method to place the name where I need it in the tile itself), but it's still an inconveniance.
[ June 27, 2005: Message edited by: Karl Beowulph ]
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here are two other options:

1) In your SetupActions, clear the field (or just go ahead and clear all of the fields).

2) Use redirects.
 
Karl Beowulph
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The redirects did exactly what I needed them to.

Thank you Marc, you've saved me from alot of hassle here.
 
reply
    Bookmark Topic Watch Topic
  • New Topic