What is the difference between put and add method in statehelper in JSF 2
问题 What is the difference between: Object put(Serializable key, Object value) void add(Serializable key, Object value) methods in StateHelper in JSF? 回答1: I found the api documentation not that helpful myself and investigated it. Each time add is called it appends another value to a list which is saved under the given key. If you call a get on that key you get back a list. The add method saves you creating that list and watches for corner cases, ex. creating the list when the key is empty. The