问题
My MBean is @ViewScope and the @PostConstruct is called when new instance is created and when made ajax request. this should happen?
回答1:
This behavior is a bug in JSF that will be fixed only in the (upcoming) version 2.2 of mojarra.
See the detailed answer here: stackoverflow.com/questions/8804317/...
回答2:
@ViewScope beans have problems with some tags. for example:
<ui:include/><ui:composition/><c:forEach/>
If your page has these tags, you may have a problem.
来源:https://stackoverflow.com/questions/5427766/problem-with-viewscope-and-the-postconstruct