The referer has two main problems
a)      it is not dependable.  Not all browsers send it all the time.
b)      It is very easily spoofable.  

The best way is just to somehow store where they were last at on the server
end, where the information is reliable and not spoofable.

Perhaps you can use the referer AND your own storage, and when the referer
specifies a different page than your own storage, use the referer value.
This might happen if they pressed the back button in IE, for example
(doesn't reload page)

Tony Wilson

                -----Original Message-----
                From:   Robert S. Sfeir [mailto:[EMAIL PROTECTED]]
                Sent:   Friday, January 19, 2001 12:42 PM
                To:     Orion-Interest
                Subject:        Re: Getting back to the previous jsp

                You can also store the referrer and send them back a page.
Since that's 
                where they came from, that's where they'll go back to.  This
way you don't 
                have to be browser specific at all... but that's kinda ugly.

                R

                At 06:00 PM 1/19/2001 +0100, you wrote:
                >If you're not using a lot of framesets and do not need to
support all
                >browser try using a javascript, like
                >
                >< a href="javascript: history.back(-1);">Back</a>
                >
                >I didn't quite understand your question, but I hope the
answer will help
                >you.
                >
                >regards
                >
                >
                >Johan Fredriksson
                >----- Original Message -----
                >From: "Randahl Fink Isaksen" <[EMAIL PROTECTED]>
                >To: "Orion-Interest" <[EMAIL PROTECTED]>
                >Sent: Friday, January 19, 2001 3:46 PM
                >Subject: Getting back to the previous jsp
                >
                >
                > > On one of my JSPs I would like to have a link to the
previous page (a
                >"back"
                > > button), but then i need to output
                > >
                > > <a href = "<%=theLinkToThePreviousPage%>"/>
                > >
                > > Does any one know how I can replace
"theLinkToThePreviousPage" with a Java
                > > expression which retrieves the correct url?
                > >
                > > Thought about letting the caller transfer the link as a
parameter to the
                > > JSP, but I would like to avoid this, if possible.
                > >
                > >
                > > Thanks
                > >
                > > Randahl
                > >



                Robert S. Sfeir
                Director of Software Development
                PERCEPTICON corporation
                San Francisco, CA 94123
                w - http://www.percepticon.com/
                e- [EMAIL PROTECTED]
                t - (415) 749-2900 x205
                

Reply via email to