如何限制在Prime主题应用程序的会话中存储视图数

Syd*_*iah 5 jsf primefaces jsf-2

我们在应用程序中使用的是primefaces 2.2.1版本。我们想将会话中存储的视图数量限制为3。我将web.xml配置为:

<context-param>
    <description>State saving method: 'client' or 'server' (=default).See JSF  Specification 2.5.2</description>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
</context-param>

<context-param>
    <description>The maximum number of logical views (GET requests) to store per session (http://tinyurl.com/yw6f2e)</description>
    <param-name>com.sun.faces.numberOfLogicalViews</param-name>
    <param-value>3</param-value>
</context-param>

<context-param>
    <description>The maximum number of JSF views (POST requests) stored in the session for per logical view (http://tinyurl.com/yw6f2e)</description>
    <param-name>com.sun.faces.numberOfViewsInSession</param-name>
    <param-value>3</param-value>
</context-param>
Run Code Online (Sandbox Code Playgroud)

看来,此配置无法正常工作。当我查看内存堆转储时,我发现会话中存储了15个视图。

使用Primefaces 2.2.1,在Mojarra 2.0.9上运行的JSF 2.0.9

有任何想法吗...