Xpages - Get number of active sessions (Lotus Domino 8.5.2)

前端 未结 1 428
心在旅途
心在旅途 2020-12-21 10:29

How do I get the number of active sessions in Xpage. I\'m trying to use managed beans but it just returns a weird string. Here\'s the simple code:

import javax.s         


        
相关标签:
1条回答
  • 2020-12-21 11:30

    A session listener must be injected in the application to get working as desired. Otherwise the sessionCreated/sessionDestroyed methods will never be called and 0is returned always. But there are some differences between XPages and "traditional" JSF. Have a look here:

    http://www.openntf.org/projects/pmt.nsf/66d9103768cc2fed85256c59006b5433/00a38cdf382f4893862578b80082dd15!OpenDocument

    Or have a look inside the XSP Starterkit.

    EDIT:

    To add a session Listener, do the following:

    1. Switch to java perspective
    2. In the "Code/Java" folder, create a folder "META-INF"
    3. In this META-INF folder, create a folder "services"
    4. In the "services" folder create a file named "com.ibm.xsp.core.events.SessionListener"
    5. In this file, add the full name of your class: package.SessionCounterListener

    Now, the session listener should be activated.

    0 讨论(0)
提交回复
热议问题