• 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

Passig values to and from JSPs to Actions without losing original values

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I have an object called 'TestObject' with parameters

TestObject.name
TestObject.email
TestObject.telNo
TestObject.dateCreated

If I'm editing the values of TestObject taken from a database and I have parameters
name, email & telNo displayed on the screen, but dateCreated is not displayed

When I click 'save' values name, email & telNo of object testObject will be passed back to my Action from my JSP, dateCreated will now be
NULL as the value was never sent to the JSP in the first place.

Is there a way in which you should handle this properly in Struts2 to retain the original value from the database, or do you have to have a hidden
field on your JSP carrying the value of dateCreated?
I ask, because potentially you could have dozens of fields which you do not want on the screen, especially if only certain values are
editable on certain screens and it seems overkill to have to have them all as hidden fields.

Hope this makes sense!

:-D
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic