开发者

What is the session size in Seam?

开发者 https://www.devze.com 2023-04-04 17:24 出处:网络
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 开发者_Go百科analyzes it.

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 开发者_Go百科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).


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);
                    }
                }
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号