[jboss-dev-forums] [Design of JBoss Portal] - how big is portal/portlet session?

prabhat.jha@jboss.com do-not-reply at jboss.com
Mon Aug 25 14:19:37 EDT 2008


Hello :-)

If I add an attribute to Portlet Session as following:

  | PortletSession session = request.getPortletSession(true);
  | Integer data = new Integer(0);
  | session.setAttribute("my_data", data);
  | 

I then do serialization/deserialization to find the size of this object:

  | ByteArrayOutputStream bs = new ByteArrayOutputStream();
  | ObjectOutputStream os = new ObjectOutputStream(bs);
  | os.writeObject(seqNumber);
  | int sessionSize = bs.size();
  | 

Does it mean that Http Session size is value of sessionSize in above code snippet?

 I have iterated through all the attributes in PortletSession (both app and portlet scope) and I see that there is  nothing else in the session. There does not seem to be a way to get hold on HttpSession from Portlet and PortletSession is not serializable and rightly so, can I safely conclude based on above code that value of sessionSize is the value of HttpSession?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172392#4172392

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172392



More information about the jboss-dev-forums mailing list