每次在客户端上点击一个按钮,然后触发事件,在服务器端得到的那个Component总是不同的,比如是这些,但每次都不同

javax.faces.component.html.HtmlCommandButton@17e4dee
javax.faces.component.html.HtmlCommandButton@b6ef8
javax.faces.component.html.HtmlCommandButton@1779885
javax.faces.component.html.HtmlCommandButton@1672bbb

后来想了想,应该是这个原因:因为组件是在服务器端生成的,用户见到的组件只是服务器端组件的映射,客户端请求发过来后服务器才根据那个请求的内容恢复视图(restore_view),所以每次处理都是不同的组件!(因为每次都会重新生成)