Guest User

Untitled

a guest
Sep 14th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. How to tell if user is submitting a form with changed values, in a Spring MVC-based webapp?
  2. @Override
  3. public int hashCode() {
  4. return Objects.hashCode(this.field1, this.field2, etc.);
  5. }
  6.  
  7. public static boolean hasFormChanged(Object form1, Object form2) {
  8. return HashCodeBuilder.reflectionHashCode(form1) != HashCodeBuilder.reflectionHashCode(form2);
  9. }
Add Comment
Please, Sign In to add comment