Re: Use of Referer header

2004-11-11 Thread Jon Wingfield
Also from Section 14.36 of rfc2616:
extract
The Referer field MUST NOT be sent if the Request-URI was obtained from 
source that does not have its own URI, such as input from the user keyboard.
/extract

So you can't rely on it being present.
Shapira, Yoav wrote:
Hi,

But I have 2 questions:
1. Where are these header values defined I've not beeen able to find a
good source.

See the HTTP protocol RFC itself for common headers like referrer.
Other servers and routers may add custom headers along the way.  Your
app and other apps can also use custom headers if they wish.

2.  It worked when coming from my pages but I then tried going to
another page (e.g www.sun.com) and then pasting in the url and it just
returned null. Does referer only apply when hyperlink from another
page ?
Some browsers, including IE, are known to have bugs regarding the
referrer header.  Sometimes it's null or not included in the request at
all.  So your app, if it uses the referrer header, must be tolerant of
these bugs.
What about a history.go(-1) alternative to the referrer header?
Yoav

This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Use of Referer header

2004-11-11 Thread Paul Taylor
Ok, I misunderstood what it did. It seems to work ok on both IE and 
Firefox always returning a value when navigating from a page but being 
null when accessing the page directly because there is no referer.

So Ive just coded my page like to only show a back link when actually 
come from another page.

% if (request.getHeader(REFERER)!=null) { %
   pa href=%=request.getHeader(REFERER)%back/a/p
% } %
p/p
Jon Wingfield wrote:
Also from Section 14.36 of rfc2616:
extract
The Referer field MUST NOT be sent if the Request-URI was obtained 
from source that does not have its own URI, such as input from the 
user keyboard.
/extract

So you can't rely on it being present.
Shapira, Yoav wrote:
Hi,

But I have 2 questions:
1. Where are these header values defined I've not beeen able to find a
good source.

See the HTTP protocol RFC itself for common headers like referrer.
Other servers and routers may add custom headers along the way.  Your
app and other apps can also use custom headers if they wish.

2.  It worked when coming from my pages but I then tried going to
another page (e.g www.sun.com) and then pasting in the url and it just
returned null. Does referer only apply when hyperlink from another

page ?
Some browsers, including IE, are known to have bugs regarding the
referrer header.  Sometimes it's null or not included in the request at
all.  So your app, if it uses the referrer header, must be tolerant of
these bugs.
What about a history.go(-1) alternative to the referrer header?
Yoav

This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, 
proprietary and/or privileged.  This e-mail is intended only for the 
individual(s) to whom it is addressed, and may not be saved, copied, 
printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your 
computer system and notify the sender.  Thank you.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Use of Referer header

2004-11-10 Thread Paul Taylor
I have a WebPage which can be called from two different webpages, and I 
wanted it to have a back button.

Originally I had the calling pages passing a parameter to tell the 
called page what called it. Then someone pointed
out %=request.getHeader(REFERER)% to m. This works much better.

But I have 2 questions:
1. Where are these header values defined I've not beeen able to find a 
good source.
2.  It worked when coming from my pages but I then tried going to 
another page (e.g www.sun.com) and then pasting in the url and it just 
returned null. Does referer only apply when hyperlink from another  page ?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Use of Referer header

2004-11-10 Thread Shapira, Yoav

Hi,

But I have 2 questions:
1. Where are these header values defined I've not beeen able to find a
good source.

See the HTTP protocol RFC itself for common headers like referrer.
Other servers and routers may add custom headers along the way.  Your
app and other apps can also use custom headers if they wish.

2.  It worked when coming from my pages but I then tried going to
another page (e.g www.sun.com) and then pasting in the url and it just
returned null. Does referer only apply when hyperlink from another
page ?

Some browsers, including IE, are known to have bugs regarding the
referrer header.  Sometimes it's null or not included in the request at
all.  So your app, if it uses the referrer header, must be tolerant of
these bugs.

What about a history.go(-1) alternative to the referrer header?

Yoav



This e-mail, including any attachments, is a confidential business 
communication, and may contain information that is confidential, proprietary 
and/or privileged.  This e-mail is intended only for the individual(s) to whom 
it is addressed, and may not be saved, copied, printed, disclosed or used by 
anyone else.  If you are not the(an) intended recipient, please immediately 
delete this e-mail from your computer system and notify the sender.  Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Use of Referer header

2004-11-10 Thread Ben Souther

The browser generates the HTTP headers and there are some rules
governing when they are to be sent.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

This isn't really Tomcat specific so I'm marking [OT]
You may find more enthusiastic help on a JSP/Servlet list.

-Ben















On Wed, 2004-11-10 at 12:30, Paul Taylor wrote:
 I have a WebPage which can be called from two different webpages, and I 
 wanted it to have a back button.
 
 Originally I had the calling pages passing a parameter to tell the 
 called page what called it. Then someone pointed
 out %=request.getHeader(REFERER)% to m. This works much better.
 
 But I have 2 questions:
 1. Where are these header values defined I've not beeen able to find a 
 good source.
 2.  It worked when coming from my pages but I then tried going to 
 another page (e.g www.sun.com) and then pasting in the url and it just 
 returned null. Does referer only apply when hyperlink from another  page ?
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[OT] Re: Use of Referer header

2004-11-10 Thread Ben Souther
On Wed, 2004-11-10 at 12:52, Ben Souther wrote:
 The browser generates the HTTP headers and there are some rules
 governing when they are to be sent.
 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
 
 This isn't really Tomcat specific so I'm marking [OT]
 You may find more enthusiastic help on a JSP/Servlet list.
 
 -Ben
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 On Wed, 2004-11-10 at 12:30, Paul Taylor wrote:
  I have a WebPage which can be called from two different webpages, and I 
  wanted it to have a back button.
  
  Originally I had the calling pages passing a parameter to tell the 
  called page what called it. Then someone pointed
  out %=request.getHeader(REFERER)% to m. This works much better.
  
  But I have 2 questions:
  1. Where are these header values defined I've not beeen able to find a 
  good source.
  2.  It worked when coming from my pages but I then tried going to 
  another page (e.g www.sun.com) and then pasting in the url and it just 
  returned null. Does referer only apply when hyperlink from another  page ?
  
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]