i made the getter and setter for person object in my action class
and in jsp page i update some fields
then when i submit the form new object is created instead of some of fields change....
if i set all other fields in hidden tag den its ok... is there any solution that we do not have to save other properties of person object in hidden tags
Let me get this straight. You present data to the user, the user changes the data, and you are surprised that when the data is submitted to the server, it is changed? Sounds to me like it is working as designed.
If you don't want the data changed, perhaps you should save a copy off somewhere.
I see what you are saying. With Struts, you write an object's state to a JSP page, throw it over to the browser, then Struts reconstitutes the object and hands it to your action. If you don't put all the fields on the JSP, Struts can't retrieve that information. You have a couple of options:
1. use hidden fields, as you know.
2. put the object in the session and copy the updated values into that object.
3. only consider fields that you have on the JSP page, ignoring fields you know will be null
4. make your class structure reflect that of your JSP page. This is probably the "best" option, since we want our classes to model the real world, and they are less error prone than the previous suggestions. I usually make a class hierarchy with a simple (user name) object for list purposes, a more complex subclass for user purposes (address, phone), then a even more complex subclass for administration purposes (department assignment, mail code). This way, each JSP and action only deal with the fields then are presenting and editing.