Seam 中的会话大小是多少?

发布于 2024-12-04 08:40:58 字数 182 浏览 1 评论 0原文

我想知道我的应用程序中的会话大小以对其进行优化。为了找到这个大小,我使用 mat 进行堆转储并对其进行分析。

Seam 在哪里存储会话和会话 bean?

我虽然它在 org.apache.catalina.session.StandardSession 中,但显然没有(我在这个 bean 中只有 2 个八位字节)。

I would like to know my session size in my application to optimize it. To find this size, I use mat which does a heap dump and analyzes it.

Where does Seam store session and conversation beans?

I though it was in org.apache.catalina.session.StandardSession but visibly no (I have only 2 octets in this bean).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜还是长夜 2024-12-11 08:40:58

Seam 将所有内容存储在 HttpSession 中。

Name("someFilter")
@Filter(around = { "org.jboss.seam.web.ajax4jsfFilter" })
@Scope(ScopeType.APPLICATION)
@Startup
@BypassInterceptors
public class SomeFilter extends AbstractFilter {

private static final LogProvider log = Logging.getLogProvider(SomeFilter.class);

@SuppressWarnings("unchecked")
public void doFilter(ServletRequest request, ServletResponse resp, FilterChain arg2) throws IOException, ServletException {
    if (HttpServletRequest.class.isAssignableFrom(request.getClass())) {
        HttpServletRequest req = (HttpServletRequest) request;
        HttpServletResponse response = (HttpServletResponse) resp;
        HttpSession session = req.getSession();
                if (log.isInfoEnabled()) {
                    List<String> attrNames = Collections.list(session.getAttributeNames());
                    for (String o : attrNames) {
                        log.info("objects in session " + o);
                    }
                }
    }
}

Seam stores everything in the HttpSession.

Name("someFilter")
@Filter(around = { "org.jboss.seam.web.ajax4jsfFilter" })
@Scope(ScopeType.APPLICATION)
@Startup
@BypassInterceptors
public class SomeFilter extends AbstractFilter {

private static final LogProvider log = Logging.getLogProvider(SomeFilter.class);

@SuppressWarnings("unchecked")
public void doFilter(ServletRequest request, ServletResponse resp, FilterChain arg2) throws IOException, ServletException {
    if (HttpServletRequest.class.isAssignableFrom(request.getClass())) {
        HttpServletRequest req = (HttpServletRequest) request;
        HttpServletResponse response = (HttpServletResponse) resp;
        HttpSession session = req.getSession();
                if (log.isInfoEnabled()) {
                    List<String> attrNames = Collections.list(session.getAttributeNames());
                    for (String o : attrNames) {
                        log.info("objects in session " + o);
                    }
                }
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文