You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by cr...@locus.apache.org on 2000/11/21 00:59:44 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/facade HttpServletResponseFacade.java

craigmcc    00/11/20 15:59:43

  Modified:    src/share/org/apache/tomcat/facade Tag: tomcat_32
                        HttpServletResponseFacade.java
  Log:
  Intra-document references (i.e. relative urls starting with "#") never
  need to be encoded.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.2   +7 -3      jakarta-tomcat/src/share/org/apache/tomcat/facade/Attic/HttpServletResponseFacade.java
  
  Index: HttpServletResponseFacade.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/facade/Attic/HttpServletResponseFacade.java,v
  retrieving revision 1.6.2.1
  retrieving revision 1.6.2.2
  diff -u -r1.6.2.1 -r1.6.2.2
  --- HttpServletResponseFacade.java	2000/07/03 09:46:29	1.6.2.1
  +++ HttpServletResponseFacade.java	2000/11/20 23:59:43	1.6.2.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/facade/Attic/HttpServletResponseFacade.java,v 1.6.2.1 2000/07/03 09:46:29 bergsten Exp $
  - * $Revision: 1.6.2.1 $
  - * $Date: 2000/07/03 09:46:29 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/facade/Attic/HttpServletResponseFacade.java,v 1.6.2.2 2000/11/20 23:59:43 craigmcc Exp $
  + * $Revision: 1.6.2.2 $
  + * $Date: 2000/11/20 23:59:43 $
    *
    * ====================================================================
    *
  @@ -328,6 +328,10 @@
        * @param location Absolute URL to be validated
        **/
       private boolean isEncodeable(String location) {
  +
  +        // Is this an intra-document reference?
  +        if (location.startsWith("#"))
  +            return (false);
   
   	// Are we in a valid session that is not using cookies?
   	Request request = response.getRequest();
  
  
  

Re: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/facade HttpServletResponseFacade.java

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
"Craig R. McClanahan" wrote:
> 
> Hans Bergsten wrote:
> 
> > craigmcc@locus.apache.org wrote:
> > >
> > > craigmcc    00/11/20 15:59:43
> > >
> > >   Modified:    src/share/org/apache/tomcat/facade Tag: tomcat_32
> > >                         HttpServletResponseFacade.java
> > >   Log:
> > >   Intra-document references (i.e. relative urls starting with "#") never
> > >   need to be encoded.
> >
> > I'm not sure I follow th logic here; why don't they have to be encoded?
> > Even this type of reference results in a new request to the server
> > when a user clicks on it, so I assume the new request must include
> > the session ID for session tracking to work.
> >
> 
> According to the URI RFC (2316?), a relative URI like this:
> 
>     <a href="#foo">Go to foo on this page</a>
> 
> should not generate a new request.  That also reflects my experience with them.
> Therefore, they need not be URL encoded.  (And, for good measure, where would
> you put the ";jsessionid=xxx" anyway, since the #foo part is supposed to go
> last?)

Okay, thinking a bit more about it, you're probably right. Sorry ;-)

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com

Re: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/facade HttpServletResponseFacade.java

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Hans Bergsten wrote:

> craigmcc@locus.apache.org wrote:
> >
> > craigmcc    00/11/20 15:59:43
> >
> >   Modified:    src/share/org/apache/tomcat/facade Tag: tomcat_32
> >                         HttpServletResponseFacade.java
> >   Log:
> >   Intra-document references (i.e. relative urls starting with "#") never
> >   need to be encoded.
>
> I'm not sure I follow th logic here; why don't they have to be encoded?
> Even this type of reference results in a new request to the server
> when a user clicks on it, so I assume the new request must include
> the session ID for session tracking to work.
>

According to the URI RFC (2316?), a relative URI like this:

    <a href="#foo">Go to foo on this page</a>

should not generate a new request.  That also reflects my experience with them.
Therefore, they need not be URL encoded.  (And, for good measure, where would
you put the ";jsessionid=xxx" anyway, since the #foo part is supposed to go
last?)

>
> Hans

Craig



Re: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/facade HttpServletResponseFacade.java

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
craigmcc@locus.apache.org wrote:
> 
> craigmcc    00/11/20 15:59:43
> 
>   Modified:    src/share/org/apache/tomcat/facade Tag: tomcat_32
>                         HttpServletResponseFacade.java
>   Log:
>   Intra-document references (i.e. relative urls starting with "#") never
>   need to be encoded.

I'm not sure I follow th logic here; why don't they have to be encoded?
Even this type of reference results in a new request to the server 
when a user clicks on it, so I assume the new request must include
the session ID for session tracking to work.

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com