You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by jm...@apache.org on 2001/12/12 07:36:00 UTC

cvs commit: jakarta-turbine-3/src/java/org/apache/turbine DynamicURI.java

jmcnally    01/12/11 22:36:00

  Modified:    src/java/org/apache/turbine DynamicURI.java
  Log:
  added getters for relative and encodeUrl properties.
  
  Revision  Changes    Path
  1.4       +28 -5     jakarta-turbine-3/src/java/org/apache/turbine/DynamicURI.java
  
  Index: DynamicURI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-3/src/java/org/apache/turbine/DynamicURI.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DynamicURI.java	2001/12/12 02:14:41	1.3
  +++ DynamicURI.java	2001/12/12 06:36:00	1.4
  @@ -84,7 +84,7 @@
    * @author <a href="mailto:jon@clearink.com">Jon S. Stevens</a>
    * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
    * @author <a href="mailto:jmcnally@collab.net">John McNally</a>
  - * @version $Id: DynamicURI.java,v 1.3 2001/12/12 02:14:41 jmcnally Exp $
  + * @version $Id: DynamicURI.java,v 1.4 2001/12/12 06:36:00 jmcnally Exp $
    */
   public class DynamicURI
   {
  @@ -127,8 +127,8 @@
       /** Q = 1 for query data. */
       protected static final int QUERY_DATA = 1;
   
  -    /** true=absolute url's; false=relative url's */
  -    private boolean isAbsolute = true;
  +    /** true=relative url's; false=absolute url's */
  +    private boolean isRelative = false;
   
       /**
        * true=url will be rewritten with session_id if needed; false=url will
  @@ -765,11 +765,22 @@
        */
       public DynamicURI setRelative(boolean b)
       {
  -        isAbsolute = !b;
  +        isRelative = b;
           return this;
       }
   
       /**
  +     * Will a call to toString() generate a relative url?
  +     * where relative means no scheme, domain, and port info
  +     *
  +     * @return a <code>boolean</code>
  +     */
  +    public boolean isRelative()
  +    {
  +        return isRelative;
  +    }
  +
  +    /**
        * Can be used to disable url rewriting.
        *
        * @param b a <code>boolean</code> 
  @@ -782,6 +793,18 @@
       }
   
       /**
  +     * Will a call to toString() add session info if needed to maintain
  +     * a session.  Does not determine whether the url will be rewritten,
  +     * only that it might be.
  +     *
  +     * @return a <code>boolean</code>
  +     */
  +    public boolean isEncodeUrl()
  +    {
  +        return encodeUrl;
  +    }
  +
  +    /**
        * Builds the URL with all of the data URL-encoded as well as
        * encoded using HttpServletResponse.encodeUrl().
        *
  @@ -802,7 +825,7 @@
       public String toString()
       {
           StringBuffer output = new StringBuffer();
  -        if (isAbsolute)
  +        if (!isRelative)
           {
               output.append ( getServerScheme() );
               output.append ( "://" );
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>