obtaining the last page the browser was at

O

Oxnard

How do I do this with servlets?

Additionally the servlet is being called from a html form using the post
method.

Would it just be easier to set an attribute?

Thanks
 
C

Chris Smith

Oxnard said:
How do I do this with servlets?

Additionally the servlet is being called from a html form using the post
method.

Would it just be easier to set an attribute?

If the user reached a page by following a link, web browsers
traditionally set the "Referer" header to the URL of the previous page.
You can retrieve the value of this header from ther ServletRequest.
However, the information in that header is provided voluntarily by the
browser, and if the browser doesn't give it, then you can't retrieve it.

If you're intending to use this for navigation within your web
application, then it would be better to explicitly store any information
you need, whether in hidden form fields, session attributes, or
whatever.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
O

Oxnard

Chris Smith said:
If the user reached a page by following a link, web browsers
traditionally set the "Referer" header to the URL of the previous page.
You can retrieve the value of this header from ther ServletRequest.
However, the information in that header is provided voluntarily by the
browser, and if the browser doesn't give it, then you can't retrieve it.

If you're intending to use this for navigation within your web
application, then it would be better to explicitly store any information
you need, whether in hidden form fields, session attributes, or
whatever.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

That's what it was looking like to me. Thanks for confirming what I was
thinking.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top