I believe some browsers don't issue a referrer header.

You could always store the page history in the http session.  At the top
of every JSP (using an @include or custom tag) you could have code like
this:

<%
        String lastPage = session.getAttribute("lastPage");

        String currURL;
        if (request.getQueryString() == null)
                currURL= request.getRequestURI();
        else
                currURL= request.getRequestURI() + "?" +
request.getQueryString();

        session.setAttribute("lastPage", currURL);
%>

You would think there should be an easier way to get the URL, but I
haven't found it.

Jeff

>-----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