AW: solution for HttpSession
Joerg Lensing <[email protected]>
| Newsgroups | gmane.comp.java.strutscx.user |
|---|---|
| Message-ID | <[email protected]> |
>
>
>Hi Joerg,
>
>to make it easy for me I could say: Do not put these Objects into the
>Session.
>- Seriously: As far as I know there are scalability problems, i.e. if you
>want to run your application in a load balanced system, if you do have these
>Objects in in the HttpSession, because the HttpSession is bound to the Java
>Virtual Machine. - I remember that the most recent or in one of the next
>Servlet specifications this limitation may change.
>
>The StrutsCXTransformer just serializes the Attribute names and values. For
>Objects this is basically the Object ID which. It therefore uses the
>java.lang.Object's toString() method. Check out what the API says:
>
>http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#toString()
>
>I'm not sure if you do, but it's a good idea not to overwrite the toString()
>method.
>
J.Bloch ("effective java") says[translated from the german edition]:
"you should always overwrite toString().....
...this mehtod intends
to help the _user_ of the class...
...if possible, this
method should return all interesting dato..
and some more good reasons.
> Use any other method name if you go to write out data.
>
no good idea, because of the (un)expected behavior of this method
>
>Maybe you do have a lot of objects in your sessions. In fact StrutsCX will
>print out all there object ids. To everybody: Please let me know if this
>behavior should change - or should be set through a parameter in the
>strutscx-config.xml.
>
>Hope this will answer your request.
>
>Regards,
>
I commented out a part of the method (the for-loop). I hope this causes
no trouble?
For now, it works fine
joerg
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps