geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Quintin Beukes <quin...@skywalk.co.za>
Subject Re: Stateful session bean has no state
Date Mon, 12 Oct 2009 19:50:48 GMT
Are you storing your session bean instance in the servlet/JSP session context?

Quintin Beukes



On Mon, Oct 12, 2009 at 8:48 PM, Antonio Fornié
<sitaronocturnal@gmail.com> wrote:
>
> Hello again!
>
> I made a stateful sessiob bean and it's working the same way my stateless
> beans do: they forget their state. Here's my code:
>
> @Stateful
> public class CartBean implements CartLocal {
>
>        private Integer number = new Integer(0);
>
>        public void setNumber(Integer number) {
>                this.number = number;
>        }
>
>        public Integer getNumber() {
>                return this.number;
>        }
>
>        @Override
>        public Integer getNumberService() {
>                this.number += 10;
>                return this.productNumber;
>        }
>
> }
>
> My jsp uses CartLocal interface wich only shows "getNumberService()" method.
> When requesting the jsp with my web browser it always shows ten. when
> refreshing the page it should show 20, but once again shows 10. What am I
> doing wrong?
>
> Thank you very much!
> --
> View this message in context: http://www.nabble.com/Stateful-session-bean-has-no-state-tp25861132s134p25861132.html
> Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.
>
>

Mime
View raw message