It's the classic Back Button Problem, that any system with session objects, not
just servlets, faces. My suggestion would be that you do your second option:
keep some sort of unique identifier (such as bill date) and always submit it as
a parameter in your navigation buttons. Then your servlet can check to make
sure it's got the correct bill object; if not, construct it. That's what I
generally do.
I know that some people try to hack around it by trying to disable the back
button in one way or another using client-side javascript, but I am not a fan
of this. It's ugly and confuses people.
Jennifer
Girish Juneja wrote:
> I was wondering if any of you ran into this servlet session related
> problem.
>
> I have a bill object that I keep in session, unfortunately, this object can
> contain
> different data depending upon what user clicked, for example, a click on
> "past statement" fills up bill object with past bill using date provided as
>
> argument. A click on "current statement" fills up bill object with current
> bill.
>
> If user is using the links I provide in HTML pages, things are kosher, but
> if
> he/she/it uses Back button in Browser, things go crazy, as the session
> object is still
> reflecting old data, and any further navigation causes error as it uses the
> old data.
>
> There are 2 bad (in my view) to solve this:
>
> 1) Have a hash of bill objects (memory intensive, overkill)
> 2) Carry around a billdate in URL, that has to be checked always with
> billdate in session.
>
> Is there anything better out there?
>
> Thanks a lot,
>
> Girish
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html