【问题标题】:Post Construct is not called不调用 Post Construct
【发布时间】:2014-01-24 22:32:10
【问题描述】:

我用 post 构造方法(使用 @PostContruct)编写了一个托管 bean,但没有调用该方法。我将 liferay liferay-portal-6.1.2-ce-ga3 与 Jboss 7.1.1 和 Icefaces 3.0 一起使用。有人可以帮我解决这个问题吗?



    @SessionScoped
    @ManagedBean
    public class DetalleVaPortletBean extends BackingPortletUI {
private static final long serialVersionUID = -7127465434575796794L;
public DetalleVaPortletBean() { try { System.out.println(this); } catch (Exception e) { error(e); } } @PostConstruct public void postConstruct(){ adicionarPortletPrincipal(); } }

【问题讨论】:

  • 这是一个 Spring 配置,我没有使用 Spring

标签: java liferay icefaces-3 postconstruct


【解决方案1】:

首先,确保您的 DetalleVaPortletBean 对象确实是通过检查控制台输出构造并定位输出 System.out.println(this);

在构造函数中添加一些打印输出可能会有所帮助,例如System.out.println("DetalleVaPortletBean CTOR");

【讨论】:

    猜你喜欢
    • 2021-07-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-02-28
    • 1970-01-01
    • 2013-07-25
    相关资源
    最近更新 更多