什么时候使用f:viewAction/preRenderView与PostConstruct?
f:viewAction
preRenderView
@PostConstruct
@RequestScoped
f:viewAction
preRenderView
@PostConstruct
F:视图或预渲染视图
<f:metadata> <f:viewAction action="#{myBean.initialize}" /></f:metadata>
<f:metadata> <f:event type="preRenderView" listener="#{myBean.initialize}"/></f:metadata>
@PostConstruct
public class MyBean{ @PostConstruct public void initialize() { }}
温温酱
相关分类