[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Brower Back button question

Posted on 2006-11-04
6
Medium Priority
?
268 Views
Last Modified: 2010-04-06
Hi, experts,

Is there a way that a PAGE can tell which PAGE the user navigated from by licking the back button from the brower.

I tested both request.servervariables("HTTP_REFERER") in ASP and request.getheader("REFER") in jsp, both does not working in case of Back button navigation instead of a real request --- it's understandable.

A link to certain page is clicked out side of a J2EE application and the application is handling the request by a typital servelet gateway and then redirected it to certain dedicate page (A.jsp) from there a FORM submit is made to final page(B.jsp)

I think it's a typical design, but since the redirect is made through the framework (submit ,etc), pressong back button from b.jsp can only goes back to the redirecting page A.jsp and then loop back to B.

obviously location.replace does not working as I tested, I am thinking to use location.go(-2) on the A.jsp but  I need to know where the request is coming from to make the decision...

Any input is highly appreciated!

0
Comment
Question by:ca_roland
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 35

Accepted Solution

by:
Raynard7 earned 300 total points
ID: 17875477
No,

for a back button there is no header being sent to the server - if there is a refresh the browser treats it as sending the same header it sent when originally loading the page.

You potentially could write a cookie when loading a page of yours so then if there is a back button being pressed and there is the same session but a different page you could register it - but apart from that I do not know of a solution.
0
 

Author Comment

by:ca_roland
ID: 17876136
Raynard7,

Can you explain this more :

  if there is a back button being pressed and there is the same session but a different page you could register it

0
 

Author Comment

by:ca_roland
ID: 17876141
Raynard7,
 
 
How about if  the user disable the cockie, then I guess, it will invovled in a framework for statement--- correct me if I am wrong
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:ca_roland
ID: 17876180
Imean : " invovled in a framework for statement management"
0
 
LVL 26

Assisted Solution

by:DireOrbAnt
DireOrbAnt earned 450 total points
ID: 17877094
It would be a breach on privacy/security and the browser sandbox to allow you to retrieve the browser history.
Like Raynard7 proposed you can implement it yourself using some kind of session, but yes, if you use cookies, they can disable them.
I don't know about jsp, but .net 2.0 allow cookie-less sessions by transforming the URL (adding a subfodler with the sessionid in it).
You could also throw a sessionid as a form element, but that tends to be a lot of management.
0
 
LVL 4

Assisted Solution

by:yeroket
yeroket earned 450 total points
ID: 17879099
if page A and B are on the same server, then the servlet can dispatch page B as the result without dispatching a middle/forwarding page. by doing:
import javax.servlet.RequestDispatcher;

RequestDispatcher dispatcher = request.getRequestDispatcher("B.jsp");

dispatcher.forward(request, response);
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question