This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hello! I display some data from a database to a user. The data lives in an ActionForm. A user may change the data and in this case I want to save it to the DB. But I am looking for a way not to save data if nothing was changed. Is there a way to do it with Struts? thanks in advance
Not in Struts per se but you can do it with POJOs (Plain Old Java Objects) and overriding the equals() method. Basically, you put all new values in one instance, then see if it equals() another instance that has the old values. This JavaWorld article talks about how to override equals().