Sorry, I don't know SpringMVC, so my answer may be wrong.
With another binding structure called Stripes, we usually “hydrate” the data before binding. This means that you first load the bean from db, and only then will you bind the value A and B to it! But it still has the original values of C and D, since the bean comes from the database (usually a JPA object). Thus, you do not need hidden fields C and D!
Seems possible with SpringMVC: Spring MVC 3.0: how do I bind to a persistent object
Note that you can also load the binding to a “non-DB bean” as you actually are (so you will have fields C and D, I think if you do not use hidden fields). Then you can simply load the bean that you want to change from the database and merge between the attached bean and db bean fields you want (here you merge only A and B so that the fields C and D in the DB bean are not changed)
Here you can find interesting material on data binding. For me, in some complex cases, binding directly to database objects can be dangerous: Using the binding infrastructure efficiently
source share