struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Slattery, Tim - BLS" <Slattery....@bls.gov>
Subject RE: Using Validator To Avoid Database Trip
Date Tue, 03 Feb 2004 15:11:45 GMT
> I have an "Edit Existing Record" screen. When the user clicks 
> the Save button on this screen, I'm supposed to store the 
> changed data in the database. However there may be a 
> situation where the user leaves the data unchanged & still 
> presses the Save button. In this case, I want to avoid the 
> database trip. Can I achieve this using the Validator 
> framework? 

I can't see how Validator would help. I handle this by including a hidden
element in the page which contains the original value of the data. When the
form is submitted, I can compare that hidden value to the value that was
exposed to the user. If they differ, then the database needs to be updated.

--
Tim Slattery
Slattery@bls.gov


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message