On 3/17/07, peter royal <[EMAIL PROTECTED]> wrote:
On Mar 16, 2007, at 7:46 AM, Coding Horse wrote:
> I have a quick question about storing a stateful Integer as a session
> attribute.
>
> This attribute "sequenceNumber" of type Integer holds an increasing
> sequence
> number.  Do I need to save it back with
> session.setAttribute("sequenceNumber", new Integer
> (theModifiedIntValue))
> after I modify it?

Yes. Java Integer objects are immutable.

You can use MutableInteger in Jakarta Commons Lang alternatively.

I prefer to use SingleSessionIoHandler in
org.apache.mina.handler.multiton package if I need to maintain the
state of a session.

Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Reply via email to