Update of /var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/pageflow
In directory james.mmbase.org:/tmp/cvs-serv8337

Modified Files:
        UrlTag.java Url.java 
Log Message:
Backwards compatibiliyt issue. UrlTag#getUrl() did not behave any more as in 
1.8 (it ignored 'absolute' attribute)


See also: 
http://cvs.mmbase.org/viewcvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/pageflow


Index: UrlTag.java
===================================================================
RCS file: 
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/pageflow/UrlTag.java,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -b -r1.127 -r1.128
--- UrlTag.java 26 Jan 2009 13:33:43 -0000      1.127
+++ UrlTag.java 10 Mar 2009 17:51:30 -0000      1.128
@@ -30,7 +30,7 @@
  * A Tag to produce an URL with parameters. It can use 'context' parameters 
easily.
  *
  * @author Michiel Meeuwissen
- * @version $Id: UrlTag.java,v 1.127 2009/01/26 13:33:43 michiel Exp $
+ * @version $Id: UrlTag.java,v 1.128 2009/03/10 17:51:30 michiel Exp $
  */
 
 public class UrlTag extends CloudReferrerTag  implements  ParamHandler, 
FrameworkParamHandler {
@@ -144,32 +144,22 @@
      * @deprecated
      */
     protected String getUrl() throws JspTagException {
-        try {
-            String u = url.get(escapeAmps.getBoolean(this, true));
-            log.debug("Found url " + u);
-            return u;
-        } catch (FrameworkException fe) {
-            throw new JspTagException(fe);
-        }
+        return getUrl(escapeAmps.getBoolean(this, true), url.getEncodeUrl());
     }
     /**
      * @deprecated
      */
     protected String getUrl(boolean ea, boolean eu) throws JspTagException {
         Url ur = url;
-        if (ur.encodeUrl() == eu) {
+        if (ur.getEncodeUrl() == eu && ur.getEscapeAmps() == ea) {
             ur = url;
         } else {
-            ur = new Url(url, eu);
+            ur = new Url(url, ea, eu);
             if (process.getBoolean(this, false)) {
                 ur.setProcess();
             }
         }
-        try {
-            return ur.get(escapeAmps.getBoolean(this, ea));
-        } catch (FrameworkException fe) {
-            throw new JspTagException(fe);
-        }
+        return ur.get();
     }
 
     /**


Index: Url.java
===================================================================
RCS file: 
/var/cvs/applications/taglib/src/org/mmbase/bridge/jsp/taglib/pageflow/Url.java,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- Url.java    26 Jan 2009 13:33:43 -0000      1.56
+++ Url.java    10 Mar 2009 17:51:30 -0000      1.57
@@ -35,7 +35,7 @@
  * <p>
  * The creation of the URL is delegated to the MMBase framework.
  * </p>
- * @version $Id: Url.java,v 1.56 2009/01/26 13:33:43 michiel Exp $;
+ * @version $Id: Url.java,v 1.57 2009/03/10 17:51:30 michiel Exp $;
  * @since MMBase-1.9
  */
 public class Url implements Comparable, CharSequence, Casting.Unwrappable {
@@ -104,11 +104,11 @@
     /**
      * @since MMBase-1.9.1
      */
-    Url(Url u, boolean encode) {
+    Url(Url u, boolean escapeAmps, boolean encode) {
         this.tag = u.tag;
         this.abs = u.abs;
         this.encodeUrl = encode;
-        this.escapeAmps = u.escapeAmps;
+        this.escapeAmps = escapeAmps;
         this.page = u.page;
         this.params = u.params;
         this.frameworkParams = u.frameworkParams;
@@ -224,6 +224,7 @@
     }
 
     final static Pattern ABSOLUTE_URLS = Pattern.compile("(?i)[a-z]+\\:.*");
+
     /**
      *
      */
@@ -275,6 +276,9 @@
     }
 
 
+    /**
+     * Returns the actual URL, considering all options of the url-tag, like 
'absolute' and 'encode'.
+     */
     public String get() {
         if (string != null) return string;
         try {
@@ -316,10 +320,15 @@
         return string;
     }
 
-    public boolean encodeUrl() {
+    public boolean getEncodeUrl() {
         return encodeUrl;
     }
 
+
+    public boolean getEscapeAmps() {
+        return escapeAmps;
+    }
+
     protected void invalidate() {
         log.debug("invalidating");
         if (params instanceof UrlParameters) {
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to