Author: jdonnerstag
Date: Wed Aug  8 05:41:50 2007
New Revision: 563840

URL: http://svn.apache.org/viewvc?view=rev&rev=563840
Log:
Until now we identified internally created wicket id's by a leading "_", e.g. 
_header. Since this convention is a little bit dangerous, I have extended 
ComponentTag to maintain an additional flag and changed the source code 
accordingly.

Modified:
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/ComponentTag.java
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/Markup.java
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/MarkupParser.java
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/MergedMarkup.java
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/WicketTag.java
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HtmlBodyContainer.java
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/BodyTagHandler.java
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/EnclosureHandler.java
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/HtmlHeaderSectionHandler.java
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/RelativePathPrefixHandler.java
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/WicketLinkTagHandler.java
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/WicketMessageTagHandler.java
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/AutoLinkResolver.java
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/ParentResolver.java
    
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketLinkResolver.java
    
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/link/HrefExpectedResult_2.html

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/ComponentTag.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/ComponentTag.java?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/ComponentTag.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/ComponentTag.java
 Wed Aug  8 05:41:50 2007
@@ -20,8 +20,8 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
@@ -55,13 +55,13 @@
        public static final String DEFAULT_WICKET_NAMESPACE = "wicket";
 
        /** an empty list */
-       private static final List EMPTY_LIST = new LinkedList();
+       private static final List EMPTY_LIST = new ArrayList();
 
        /**
         * Assuming this is a open (or open-close) tag, 'closes' refers to the
         * ComponentTag which closes it.
         */
-       protected ComponentTag closes;
+       private ComponentTag closes;
 
        /** The underlying xml tag */
        protected final XmlTag xmlTag;
@@ -69,7 +69,10 @@
        /** True if a href attribute is available and autolinking is on */
        private boolean autolink = false;
 
-       /** The component's id identified by wicket:id="xxx" */
+       /**
+        * By default this is equal to the wicket:id="xxx" attribute value, but 
may
+        * be provided e.g. for auto-tags
+        */
        private String id;
 
        /** The component's path in the markup */
@@ -78,15 +81,21 @@
        /** True, if attributes have been modified or added */
        private boolean modified = false;
 
-       /** If true, than the MarkupParser will ignore (remove) it. */
-       private boolean ignore = false;
+       /**
+        * If true, than the MarkupParser will ignore (remove) it. Temporary 
working
+        * variable
+        */
+       private transient boolean ignore = false;
+
+       /** If true, than the tag contain an automatically created wicket id */
+       private boolean autoComponent = false;
 
        /**
         * In case of inherited markup, the base and the extended markups are 
merged
         * and the information about the tags origin is lost. In some cases like
         * wicket:head and wicket:link this information however is required.
         */
-       private WeakReference/*<Class>*/ markupClassRef = new 
WeakReference(null);
+       private WeakReference/* <Class> */markupClassRef = null;
 
        /**
         * Tags which are detected to have only an open tag, which is allowed 
with
@@ -95,13 +104,10 @@
        private boolean hasNoCloseTag = false;
 
        /** added behaviors */
-       // FIXME these behaviors here are merely for wicket:message attributes 
on
-       // tags that are also wicket components. since this addition behavors 
have
-       // gained a significantly more sophisticated lifecycle and so managing
-       // behaviors attached to markup tags like this is much harder. this 
should
-       // be refactored into some interface that only has oncomponenttag method
-       // because a full behavior is not supported nor desired imho.
-       private Collection behaviors;
+       private List behaviors;
+
+       /** Filters and Handlers may add their own attributes to the tag */
+       private Map userData;
 
        /**
         * Automatically create a XmlTag, assign the name and the type, and
@@ -146,7 +152,7 @@
 
                if (behaviors == null)
                {
-                       behaviors = new LinkedList();
+                       behaviors = new ArrayList();
                }
                behaviors.add(behavior);
        }
@@ -308,7 +314,7 @@
         */
        public final boolean isAutolinkEnabled()
        {
-               return this.autolink;
+               return autolink;
        }
 
        /**
@@ -409,12 +415,16 @@
         * @param dest
         *            tag whose properties will be set
         */
-       void copyPropertiesTo(ComponentTag dest)
+       void copyPropertiesTo(final ComponentTag dest)
        {
                dest.id = id;
-               dest.setMarkupClass((Class)this.markupClassRef.get());
-               dest.setHasNoCloseTag(this.hasNoCloseTag);
-               dest.setPath(this.path);
+               dest.setHasNoCloseTag(hasNoCloseTag);
+               dest.setPath(path);
+               dest.setAutoComponentTag(autoComponent);
+               if (markupClassRef != null)
+               {
+                       dest.setMarkupClass((Class)markupClassRef.get());
+               }
                if (behaviors != null)
                {
                        dest.behaviors = new ArrayList(behaviors.size());
@@ -429,7 +439,7 @@
         * @param value
         *            The value
         */
-       public final void put(String key, boolean value)
+       public final void put(final String key, final boolean value)
        {
                xmlTag.put(key, value);
        }
@@ -441,7 +451,7 @@
         * @param value
         *            The value
         */
-       public final void put(String key, int value)
+       public final void put(final String key, final int value)
        {
                xmlTag.put(key, value);
        }
@@ -549,7 +559,7 @@
         */
        public final void setOpenTag(final ComponentTag tag)
        {
-               this.closes = tag;
+               closes = tag;
                getXmlTag().setOpenTag(tag.getXmlTag());
        }
 
@@ -706,7 +716,7 @@
         */
        public final boolean isModified()
        {
-               return this.modified;
+               return modified;
        }
 
        /**
@@ -758,7 +768,7 @@
         */
        public Class getMarkupClass()
        {
-               return (Class)markupClassRef.get();
+               return (markupClassRef == null ? null : 
(Class)markupClassRef.get());
        }
 
        /**
@@ -769,7 +779,14 @@
         */
        public void setMarkupClass(Class wicketHeaderClass)
        {
-               this.markupClassRef = new WeakReference(wicketHeaderClass);
+               if (wicketHeaderClass == null)
+               {
+                       markupClassRef = null;
+               }
+               else
+               {
+                       markupClassRef = new WeakReference(wicketHeaderClass);
+               }
        }
 
        /**
@@ -792,7 +809,7 @@
         */
        public boolean isIgnore()
        {
-               return this.ignore;
+               return ignore;
        }
 
        /**
@@ -804,5 +821,58 @@
        public void setIgnore(boolean ignore)
        {
                this.ignore = ignore;
+       }
+
+       /**
+        * @return True, if wicket:id has been automatically created (internal
+        *         component)
+        */
+       public boolean isAutoComponentTag()
+       {
+               return autoComponent;
+       }
+
+       /**
+        * @param auto
+        *            True, if wicket:id has been automatically created 
(internal
+        *            component)
+        */
+       public void setAutoComponentTag(boolean auto)
+       {
+               autoComponent = auto;
+       }
+
+       /**
+        * Gets userData.
+        * 
+        * @param key
+        *            The key to store and retrieve the value
+        * @return userData
+        */
+       public Object getUserData(final String key)
+       {
+               if (userData == null)
+               {
+                       return null;
+               }
+
+               return userData.get(key);
+       }
+
+       /**
+        * Sets userData.
+        * 
+        * @param key
+        *            The key to store and retrieve the value
+        * @param value
+        *            The user specific value to store
+        */
+       public void setUserData(final String key, final Object value)
+       {
+               if (userData == null)
+               {
+                       userData = new HashMap();
+               }
+               userData.put(key, value);
        }
 }

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/Markup.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/Markup.java?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/Markup.java 
(original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/Markup.java 
Wed Aug  8 05:41:50 2007
@@ -75,25 +75,7 @@
        Markup(final MarkupResourceData markupResourceData)
        {
                this.markupResourceData = markupResourceData;
-               this.markupElements = new ArrayList();
-       }
-
-       /**
-        * @return String representation of markup list
-        */
-       public final String toString()
-       {
-               final AppendingStringBuffer buf = new 
AppendingStringBuffer(400);
-               buf.append(this.markupResourceData.toString());
-               buf.append("\n");
-
-               final Iterator iter = this.markupElements.iterator();
-               while (iter.hasNext())
-               {
-                       buf.append(iter.next());
-               }
-
-               return buf.toString();
+               markupElements = new ArrayList();
        }
 
        /**
@@ -117,7 +99,7 @@
         */
        public final MarkupResourceData getMarkupResourceData()
        {
-               return this.markupResourceData;
+               return markupResourceData;
        }
 
        /**
@@ -139,7 +121,7 @@
         */
        final public void addMarkupElement(final MarkupElement markupElement)
        {
-               this.markupElements.add(markupElement);
+               markupElements.add(markupElement);
        }
 
        /**
@@ -150,7 +132,7 @@
         */
        final public void addMarkupElement(final int pos, final MarkupElement 
markupElement)
        {
-               this.markupElements.add(pos, markupElement);
+               markupElements.add(pos, markupElement);
        }
 
        /**
@@ -158,9 +140,9 @@
         */
        final void makeImmutable()
        {
-               for (int i = 0; i < this.markupElements.size(); i++)
+               for (int i = 0; i < markupElements.size(); i++)
                {
-                       MarkupElement elem = 
(MarkupElement)this.markupElements.get(i);
+                       MarkupElement elem = 
(MarkupElement)markupElements.get(i);
                        if (elem instanceof ComponentTag)
                        {
                                // Make the tag immutable
@@ -168,72 +150,11 @@
                        }
                }
 
-               this.markupElements = 
Collections.unmodifiableList(this.markupElements);
-               
+               markupElements = Collections.unmodifiableList(markupElements);
                initialize();
        }
 
        /**
-        * Reset the markup to its defaults, except for the wicket namespace 
which
-        * remains unchanged.
-        */
-       final void reset()
-       {
-               this.markupElements = new ArrayList();
-       }
-//
-//     /**
-//      * Create an iterator for the markup elements
-//      * 
-//      * @return Iterator
-//      */
-//     public final Iterator iterator()
-//     {
-//             return iterator(0, null);
-//     }
-//
-//     /**
-//      * Create an iterator for the tags being an istance of 'matchClass'
-//      * 
-//      * @param startIndex
-//      *            The index to start with
-//      * @param matchClass
-//      *            Iterate over elements matching the class
-//      * @return Iterator
-//      */
-//     public final Iterator iterator(final int startIndex, final Class 
matchClass)
-//     {
-//             return new Iterator()
-//             {
-//                     int index = startIndex - 1;
-//
-//                     public boolean hasNext()
-//                     {
-//                             while (++index < size())
-//                             {
-//                                     MarkupElement element = get(index);
-//                                     if ((matchClass == null) || 
matchClass.isInstance(element))
-//                                     {
-//                                             return true;
-//                                     }
-//                             }
-//                             return false;
-//                     }
-//
-//                     public Object next()
-//                     {
-//                             return get(index);
-//                     }
-//
-//                     public void remove()
-//                     {
-//                             markupElements.remove(index);
-//                             index -= 1;
-//                     }
-//             };
-//     }
-
-       /**
         * Add the tag to the local cache if open or open-close and if 
wicket:id is
         * present
         * 
@@ -243,12 +164,13 @@
        private void addToCache(final int index, final ComponentTag tag)
        {
                // Only if the tag has wicket:id="xx" and open or open-close
-               if ((tag.isOpen() || tag.isOpenClose()) && 
tag.getAttributes().containsKey(getMarkupResourceData().getWicketId()))
+               if ((tag.isOpen() || tag.isOpenClose()) &&
+                               
tag.getAttributes().containsKey(getMarkupResourceData().getWicketId()))
                {
                        // Add the tag to the cache
-                       if (this.componentMap == null)
+                       if (componentMap == null)
                        {
-                               this.componentMap = new HashMap();
+                               componentMap = new HashMap();
                        }
 
                        /*
@@ -268,7 +190,7 @@
                        {
                                key = tag.getId();
                        }
-                       this.componentMap.put(key, new Integer(index));
+                       componentMap.put(key, new Integer(index));
                }
        }
 
@@ -284,7 +206,8 @@
                        final ComponentTag tag)
        {
                // Only if the tag has wicket:id="xx" and open or open-close
-               if ((tag.isOpen() || tag.isOpenClose()) && 
tag.getAttributes().containsKey(markupResourceData.getWicketId()))
+               if ((tag.isOpen() || tag.isOpenClose()) &&
+                               
tag.getAttributes().containsKey(markupResourceData.getWicketId()))
                {
                        // With open-close the path does not change. It 
can/will not have
                        // children. The same is true for HTML tags like <br> 
or <img>
@@ -292,65 +215,51 @@
                        if (tag.isOpenClose() || tag.hasNoCloseTag())
                        {
                                // Set the components path.
-                               if ((this.currentPath != null) && 
(this.currentPath.length() > 0))
+                               if ((currentPath != null) && 
(currentPath.length() > 0))
                                {
-                                       
tag.setPath(this.currentPath.toString());
+                                       tag.setPath(currentPath.toString());
                                }
                        }
                        else
                        {
                                // Set the components path.
-                               if (this.currentPath == null)
+                               if (currentPath == null)
                                {
-                                       this.currentPath = new 
StringBuffer(100);
+                                       currentPath = new StringBuffer(100);
                                }
-                               else if (this.currentPath.length() > 0)
+                               else if (currentPath.length() > 0)
                                {
-                                       
tag.setPath(this.currentPath.toString());
-                                       this.currentPath.append(':');
+                                       tag.setPath(currentPath.toString());
+                                       currentPath.append(':');
                                }
 
                                // .. and append the tags id to the component 
path for the
                                // children to come
-                               this.currentPath.append(tag.getId());
+                               currentPath.append(tag.getId());
                        }
                }
-               else if (tag.isClose() && (this.currentPath != null))
+               else if (tag.isClose() && (currentPath != null))
                {
                        // For example <wicket:message> does not have an id
-                       if ((tag.getOpenTag() == null)
-                                       || 
tag.getOpenTag().getAttributes().containsKey(markupResourceData.getWicketId()))
+                       if ((tag.getOpenTag() == null) ||
+                                       
tag.getOpenTag().getAttributes().containsKey(markupResourceData.getWicketId()))
                        {
                                // Remove the last element from the component 
path
-                               int index = this.currentPath.lastIndexOf(":");
+                               int index = currentPath.lastIndexOf(":");
                                if (index != -1)
                                {
-                                       this.currentPath.setLength(index);
+                                       currentPath.setLength(index);
                                }
                                else
                                {
-                                       this.currentPath.setLength(0);
+                                       currentPath.setLength(0);
                                }
                        }
                }
 
-               return this.currentPath;
+               return currentPath;
        }
-//
-//     /**
-//      * Create an iterator for the component tags in the markup.
-//      * 
-//      * @param startIndex
-//      *            The index to start with
-//      * @param matchClass
-//      *            Iterate over elements matching the class
-//      * @return ComponentTagIterator
-//      */
-//     public Iterator componentTagIterator(final int startIndex, final Class 
matchClass)
-//     {
-//             return iterator(startIndex, matchClass);
-//     }
-       
+
        /**
         * Find the markup element index of the component with 'path'
         * 
@@ -383,13 +292,13 @@
                completePath = matcher.replaceAll("");
 
                // All component tags are registered with the cache
-               if (this.componentMap == null)
+               if (componentMap == null)
                {
                        // not found
                        return -1;
                }
 
-               final Integer value = 
(Integer)this.componentMap.get(completePath);
+               final Integer value = (Integer)componentMap.get(completePath);
                if (value == null)
                {
                        // not found
@@ -420,7 +329,7 @@
        protected void initialize()
        {
                // Reset
-               this.componentMap = null;
+               componentMap = null;
 
                if (markupElements != null)
                {
@@ -447,6 +356,24 @@
 
                // The variable is only needed while adding markup elements.
                // initialize() is invoked after all elements have been added.
-               this.currentPath = null;
+               currentPath = null;
+       }
+
+       /**
+        * @return String representation of markup list
+        */
+       public final String toString()
+       {
+               final AppendingStringBuffer buf = new 
AppendingStringBuffer(400);
+               buf.append(markupResourceData.toString());
+               buf.append("\n");
+
+               final Iterator iter = markupElements.iterator();
+               while (iter.hasNext())
+               {
+                       buf.append(iter.next());
+               }
+
+               return buf.toString();
        }
 }

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/MarkupParser.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/MarkupParser.java?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/MarkupParser.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/MarkupParser.java
 Wed Aug  8 05:41:50 2007
@@ -111,11 +111,11 @@
        public MarkupParser(final IXmlPullParser xmlParser, final 
MarkupResourceStream resource)
        {
                this.xmlParser = xmlParser;
-               this.markupSettings = Application.get().getMarkupSettings();
+               markupSettings = Application.get().getMarkupSettings();
 
                MarkupResourceData markup = new MarkupResourceData();
                markup.setResource(resource);
-               
+
                this.markup = new Markup(markup);
 
                // Initialize the markup filter chain
@@ -130,7 +130,7 @@
         */
        public final void setWicketNamespace(final String namespace)
        {
-               
this.markup.getMarkupResourceData().setWicketNamespace(namespace);
+               markup.getMarkupResourceData().setWicketNamespace(namespace);
        }
 
        /**
@@ -141,7 +141,7 @@
         */
        protected MarkupResourceStream getMarkupResourceStream()
        {
-               return this.markup.getMarkupResourceData().getResource();
+               return markup.getMarkupResourceData().getResource();
        }
 
        /**
@@ -151,10 +151,10 @@
        private final void initializeMarkupFilters()
        {
                // Chain together all the different markup filters and 
configure them
-               this.markupFilterChain = xmlParser;
+               markupFilterChain = xmlParser;
+
+               MarkupResourceData markupResourceData = 
markup.getMarkupResourceData();
 
-               MarkupResourceData markupResourceData = 
this.markup.getMarkupResourceData();
-               
                appendMarkupFilter(new WicketTagIdentifier(markupResourceData));
                appendMarkupFilter(new TagTypeHandler());
                appendMarkupFilter(new HtmlHandler());
@@ -206,8 +206,6 @@
         */
        public final void appendMarkupFilter(final IMarkupFilter filter)
        {
-               // PrependContextPathHandler should always be close to the end.
-               // It doesn't have to be last though.
                appendMarkupFilter(filter, RelativePathPrefixHandler.class);
        }
 
@@ -225,14 +223,14 @@
         */
        public final void appendMarkupFilter(final IMarkupFilter filter, final 
Class beforeFilter)
        {
-               if ((beforeFilter == null) || (this.markupFilterChain == null))
+               if ((beforeFilter == null) || (markupFilterChain == null))
                {
-                       filter.setParent(this.markupFilterChain);
-                       this.markupFilterChain = filter;
+                       filter.setParent(markupFilterChain);
+                       markupFilterChain = filter;
                }
                else
                {
-                       IMarkupFilter current = this.markupFilterChain;
+                       IMarkupFilter current = markupFilterChain;
                        while (current != null)
                        {
                                if (current.getClass() == beforeFilter)
@@ -246,8 +244,8 @@
 
                        if (current == null)
                        {
-                               filter.setParent(this.markupFilterChain);
-                               this.markupFilterChain = filter;
+                               filter.setParent(markupFilterChain);
+                               markupFilterChain = filter;
                        }
                }
        }
@@ -261,10 +259,10 @@
         */
        public final Markup parse() throws IOException, 
ResourceStreamNotFoundException
        {
-               MarkupResourceData markupResourceData = 
this.markup.getMarkupResourceData();
-               
+               MarkupResourceData markupResourceData = 
markup.getMarkupResourceData();
+
                // Initialize the xml parser
-               
this.xmlParser.parse(markupResourceData.getResource().getInputStream(), 
this.markupSettings
+               
xmlParser.parse(markupResourceData.getResource().getInputStream(), 
markupSettings
                                .getDefaultMarkupEncoding());
 
                // parse the xml markup and tokenize it into wicket relevant 
markup
@@ -274,7 +272,7 @@
                markupResourceData.setEncoding(xmlParser.getEncoding());
                
markupResourceData.setXmlDeclaration(xmlParser.getXmlDeclaration());
 
-               return this.markup;
+               return markup;
        }
 
        /**
@@ -285,7 +283,7 @@
         */
        public ComponentTag getNextTag() throws ParseException
        {
-               return (ComponentTag)this.markupFilterChain.nextTag();
+               return (ComponentTag)markupFilterChain.nextTag();
        }
 
        /**
@@ -295,13 +293,13 @@
        private void parseMarkup()
        {
                // Get relevant settings from the Application
-               final boolean stripComments = 
this.markupSettings.getStripComments();
-               final boolean compressWhitespace = 
this.markupSettings.getCompressWhitespace();
+               final boolean stripComments = markupSettings.getStripComments();
+               final boolean compressWhitespace = 
markupSettings.getCompressWhitespace();
 
                try
                {
                        // always remember the latest index (size)
-                       int size = this.markup.size();
+                       int size = markup.size();
 
                        // Loop through tags
                        ComponentTag tag;
@@ -334,7 +332,7 @@
 
                                                // Make sure you add it at the 
correct location.
                                                // IMarkupFilters might have 
added elements as well.
-                                               
this.markup.addMarkupElement(size, new RawMarkup(rawMarkup));
+                                               markup.addMarkupElement(size, 
new RawMarkup(rawMarkup));
                                        }
 
                                        if (add)
@@ -343,19 +341,19 @@
                                                // to be removed from the 
markup. (e.g. <wicket:remove>
                                                if (tag.isIgnore() == false)
                                                {
-                                                       
this.markup.addMarkupElement(tag);
+                                                       
markup.addMarkupElement(tag);
                                                }
                                        }
                                        else if (tag.isModified())
                                        {
-                                               
this.markup.addMarkupElement(new RawMarkup(tag.toCharSequence()));
+                                               markup.addMarkupElement(new 
RawMarkup(tag.toCharSequence()));
                                        }
 
                                        xmlParser.setPositionMarker();
                                }
 
                                // always remember the latest index (size)
-                               size = this.markup.size();
+                               size = markup.size();
                        }
                }
                catch (final ParseException ex)
@@ -364,14 +362,14 @@
                        final CharSequence text = 
xmlParser.getInputFromPositionMarker(-1);
                        if (text.length() > 0)
                        {
-                               this.markup.addMarkupElement(new 
RawMarkup(text));
+                               markup.addMarkupElement(new RawMarkup(text));
                        }
 
-                       
this.markup.getMarkupResourceData().setEncoding(xmlParser.getEncoding());
-                       
this.markup.getMarkupResourceData().setXmlDeclaration(xmlParser.getXmlDeclaration());
+                       
markup.getMarkupResourceData().setEncoding(xmlParser.getEncoding());
+                       
markup.getMarkupResourceData().setXmlDeclaration(xmlParser.getXmlDeclaration());
 
-                       final MarkupStream markupStream = new 
MarkupStream(this.markup);
-                       markupStream.setCurrentIndex(this.markup.size() - 1);
+                       final MarkupStream markupStream = new 
MarkupStream(markup);
+                       markupStream.setCurrentIndex(markup.size() - 1);
                        throw new MarkupException(markupStream, 
ex.getMessage(), ex);
                }
 
@@ -393,13 +391,13 @@
 
                        // Make sure you add it at the correct location.
                        // IMarkupFilters might have added elements as well.
-                       this.markup.addMarkupElement(new RawMarkup(rawMarkup));
+                       markup.addMarkupElement(new RawMarkup(rawMarkup));
                }
 
                // Make all tags immutable and the list of elements unmodifable
-               this.markup.makeImmutable();
+               markup.makeImmutable();
        }
-       
+
        /**
         * Remove whitespaces from the raw markup
         * 

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/MergedMarkup.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/MergedMarkup.java?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/MergedMarkup.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/MergedMarkup.java
 Wed Aug  8 05:41:50 2007
@@ -359,6 +359,7 @@
                                headOpenTag.setType(XmlTag.OPEN);
                                final ComponentTag openTag = new 
ComponentTag(headOpenTag);
                                
openTag.setId(HtmlHeaderSectionHandler.HEADER_ID);
+                               openTag.setAutoComponentTag(true);
 
                                final XmlTag headCloseTag = new XmlTag();
                                headCloseTag.setName(headOpenTag.getName());

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/WicketTag.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/WicketTag.java?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/WicketTag.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/WicketTag.java
 Wed Aug  8 05:41:50 2007
@@ -64,7 +64,7 @@
         */
        public final String getNameAttribute()
        {
-               return this.getAttributes().getString("name");
+               return getAttributes().getString("name");
        }
 
        /**
@@ -188,6 +188,7 @@
                {
                        final WicketTag tag = new WicketTag(xmlTag.mutable());
                        tag.setId(getId());
+                       tag.setAutoComponentTag(isAutoComponentTag());
                        return tag;
                }
        }

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HtmlBodyContainer.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HtmlBodyContainer.java?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HtmlBodyContainer.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/internal/HtmlBodyContainer.java
 Wed Aug  8 05:41:50 2007
@@ -37,7 +37,7 @@
        private static final long serialVersionUID = 1L;
 
        /** The automatically assigned wicket:id to &gt;body&lt; tag */
-       public static final String BODY_ID = "_<body>";
+       public static final String BODY_ID = "_body_";
 
        /**
         * Construct

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/BodyTagHandler.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/BodyTagHandler.java?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/BodyTagHandler.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/BodyTagHandler.java
 Wed Aug  8 05:41:50 2007
@@ -64,6 +64,8 @@
                        if (tag.getId() == null)
                        {
                                tag.setId(HtmlBodyContainer.BODY_ID);
+                               tag.setAutoComponentTag(true);
+                               tag.setModified(true);
                        }
                }
 

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/EnclosureHandler.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/EnclosureHandler.java?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/EnclosureHandler.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/EnclosureHandler.java
 Wed Aug  8 05:41:50 2007
@@ -90,49 +90,49 @@
                        // If open tag, than put the tag onto the stack
                        if (tag.isOpen())
                        {
-                               if (this.stack == null)
+                               if (stack == null)
                                {
-                                       this.stack = new Stack/* <ComponentTag> 
*/();
+                                       stack = new Stack/* <ComponentTag> */();
                                }
-                               this.stack.push(tag);
+                               stack.push(tag);
                        }
                        // If close tag, than remove the tag from the stack and 
update
                        // the child attribute of the open tag if required
                        else if (tag.isClose())
                        {
-                               if (this.stack == null)
+                               if (stack == null)
                                {
                                        throw new ParseException("Missing open 
tag for Enclosure: " + tag.toString(),
                                                        tag.getPos());
                                }
 
                                // Remove the open tag from the stack
-                               ComponentTag lastEnclosure = 
(ComponentTag)this.stack.pop();
+                               ComponentTag lastEnclosure = 
(ComponentTag)stack.pop();
 
                                // If the child attribute has not been given by 
the user,
                                // than ...
-                               if (this.childId != null)
+                               if (childId != null)
                                {
-                                       lastEnclosure.put(CHILD_ATTRIBUTE, 
this.childId);
+                                       lastEnclosure.put(CHILD_ATTRIBUTE, 
childId);
                                        lastEnclosure.setModified(true);
-                                       this.childId = null;
+                                       childId = null;
                                }
 
-                               if (this.stack.size() == 0)
+                               if (stack.size() == 0)
                                {
-                                       this.stack = null;
+                                       stack = null;
                                }
                        }
                        else
                        {
-                               throw new ParseException("Open-close tag not 
allowed for Enclosure: "
-                                               + tag.toString(), tag.getPos());
+                               throw new ParseException("Open-close tag not 
allowed for Enclosure: " +
+                                               tag.toString(), tag.getPos());
                        }
                }
                // Are we inside a wicket:enclosure tag?
                else if ((tag.getId() != null) && (isWicketTag == false) && 
(stack != null))
                {
-                       ComponentTag lastEnclosure = 
(ComponentTag)this.stack.lastElement();
+                       ComponentTag lastEnclosure = 
(ComponentTag)stack.lastElement();
 
                        // If the enclosure tag has NO child attribute, than ...
                        if (lastEnclosure.getString(CHILD_ATTRIBUTE) == null)
@@ -141,7 +141,7 @@
                                // the enclosure and are not able to 
automatically
                                // determine the child component to delegate the
                                // isVisible() to => Exception
-                               if (this.childId != null)
+                               if (childId != null)
                                {
                                        throw new ParseException(
                                                        "Use <wicket:enclosure 
child='xxx'> to name the child component", tag
@@ -149,7 +149,7 @@
                                }
                                // Remember the child id. The open tag will be 
updated
                                // once the close tag is found. See above.
-                               this.childId = tag.getId();
+                               childId = tag.getId();
                        }
                }
 

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/HtmlHeaderSectionHandler.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/HtmlHeaderSectionHandler.java?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/HtmlHeaderSectionHandler.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/HtmlHeaderSectionHandler.java
 Wed Aug  8 05:41:50 2007
@@ -43,21 +43,23 @@
        private static final String HEAD = "head";
 
        /** The automatically assigned wicket:id to &gt;head&lt; tag */
-       public static final String HEADER_ID = "-header";
+       public static final String HEADER_ID = "_header_";
 
        /** True if <head> has been found already */
        private boolean foundHead = false;
 
        /** True if all the rest of the markup file can be ignored */
        private boolean ignoreTheRest = false;
-       
+
        /** The Markup available so far for the resource */
        private final Markup markup;
-       
+
        /**
         * Construct.
         * 
-        * @param markup The Markup object being filled while reading the 
markup resource
+        * @param markup
+        *            The Markup object being filled while reading the markup
+        *            resource
         */
        public HtmlHeaderSectionHandler(final Markup markup)
        {
@@ -102,11 +104,13 @@
                                else if (tag.getId() == null)
                                {
                                        tag.setId(HEADER_ID);
+                                       tag.setAutoComponentTag(true);
+                                       tag.setModified(true);
                                }
-       
+
                                return tag;
                        }
-                       else 
+                       else
                        {
                                // we found <wicket:head>
                                foundHead = true;
@@ -137,12 +141,15 @@
                // Note: only the open-tag must be a AutoComponentTag
                final ComponentTag openTag = new ComponentTag(HEAD, 
XmlTag.OPEN);
                openTag.setId(HEADER_ID);
-               
+               openTag.setAutoComponentTag(true);
+               openTag.setModified(true);
+
                final ComponentTag closeTag = new ComponentTag(HEAD, 
XmlTag.CLOSE);
                closeTag.setOpenTag(openTag);
+               closeTag.setModified(true);
 
                // insert the tags into the markup stream
-               this.markup.addMarkupElement(openTag);
-               this.markup.addMarkupElement(closeTag);
+               markup.addMarkupElement(openTag);
+               markup.addMarkupElement(closeTag);
        }
 }

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/RelativePathPrefixHandler.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/RelativePathPrefixHandler.java?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/RelativePathPrefixHandler.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/RelativePathPrefixHandler.java
 Wed Aug  8 05:41:50 2007
@@ -26,6 +26,7 @@
 import org.apache.wicket.markup.ComponentTag;
 import org.apache.wicket.markup.MarkupElement;
 import org.apache.wicket.markup.MarkupStream;
+import org.apache.wicket.markup.WicketTag;
 import org.apache.wicket.markup.html.WebComponent;
 import org.apache.wicket.markup.html.WebMarkupContainer;
 import org.apache.wicket.markup.parser.AbstractMarkupFilter;
@@ -34,12 +35,12 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * The purpose of this filter is to make all "href", "src" and "background" src
+ * The purpose of this filter is to make all "href", "src" and "background"
  * attributes found in the markup which contain a relative URL like
  * "myDir/myPage.gif" actually resolve in the output HTML, by prefixing them
  * with with an appropriate path to make the link work properly, even if the
  * current page is being displayed at a mounted URL or whatever. It is applied
- * to all non wicket component tags' attributes.
+ * to all non wicket component tags, except for auto-linked tags.
  * 
  * It achieves this by being both an IMarkupFilter and IComponentResolver, and
  * works similarly to the &lt;wicket:message&gt; code. For each tag, we look to
@@ -65,7 +66,7 @@
         * The id automatically assigned to tags without an id which we need to
         * prepend a relative path to.
         */
-       public static final String WICKET_RELATIVE_PATH_PREFIX_CONTAINER_ID = 
"-relative_path_prefix";
+       public static final String WICKET_RELATIVE_PATH_PREFIX_CONTAINER_ID = 
"_relative_path_prefix_";
 
        /** List of attribute names considered */
        private static final String attributeNames[] = new String[] { "href", 
"src", "background" };
@@ -93,7 +94,8 @@
                                {
                                        if (prefix == null)
                                        {
-                                               prefix = 
RequestCycle.get().getRequest().getRelativePathPrefixToContextRoot();
+                                               prefix = 
RequestCycle.get().getRequest()
+                                                               
.getRelativePathPrefixToContextRoot();
                                        }
                                        attrValue = prefix + attrValue;
                                        tag.getAttributes().put(attrName, 
attrValue);
@@ -121,7 +123,8 @@
                }
 
                // Don't touch any wicket:id component and any auto-components
-               if ((tag.getId() != null) && (tag.getId().startsWith("-") == 
false))
+               if ((tag instanceof WicketTag) || (tag.isAutolinkEnabled() == 
true) ||
+                               (tag.getAttributes().get("wicket:id") != null))
                {
                        return tag;
                }
@@ -135,7 +138,11 @@
                        if ((attrValue != null) && (attrValue.startsWith("/") 
== false) &&
                                        (attrValue.indexOf(":") < 0) && 
!(attrValue.startsWith("#")))
                        {
-                               
tag.setId(WICKET_RELATIVE_PATH_PREFIX_CONTAINER_ID);
+                               if (tag.getId() == null)
+                               {
+                                       
tag.setId(WICKET_RELATIVE_PATH_PREFIX_CONTAINER_ID);
+                                       tag.setAutoComponentTag(true);
+                               }
                                tag.addBehavior(RELATIVE_PATH_BEHAVIOR);
                                tag.setModified(true);
                                break;
@@ -147,7 +154,9 @@
 
        /**
         * 
-        * @see 
org.apache.wicket.markup.resolver.IComponentResolver#resolve(org.apache.wicket.MarkupContainer,
 org.apache.wicket.markup.MarkupStream, org.apache.wicket.markup.ComponentTag)
+        * @see 
org.apache.wicket.markup.resolver.IComponentResolver#resolve(org.apache.wicket.MarkupContainer,
+        *      org.apache.wicket.markup.MarkupStream,
+        *      org.apache.wicket.markup.ComponentTag)
         */
        public boolean resolve(MarkupContainer container, MarkupStream 
markupStream, ComponentTag tag)
        {

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/WicketLinkTagHandler.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/WicketLinkTagHandler.java?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/WicketLinkTagHandler.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/WicketLinkTagHandler.java
 Wed Aug  8 05:41:50 2007
@@ -62,7 +62,7 @@
 
        /** Current status */
        private boolean autolinking = true;
-       
+
        /**
         * Construct.
         */
@@ -79,7 +79,7 @@
         */
        public void setAutomaticLinking(final boolean enable)
        {
-               this.autolinking = enable;
+               autolinking = enable;
        }
 
        /**
@@ -104,9 +104,9 @@
                // considered for autolinking. This is because it is assumed 
that Wicket
                // components like images or all other kind of Wicket Links 
will handle
                // it themselves.
-               // Subclass analyzeAutolinkCondition() to implement you own 
implementation
-               // and register the new tag handler with the markup parser 
through
-               // Application.newMarkupParser().
+               // Subclass analyzeAutolinkCondition() to implement you own
+               // implementation and register the new tag handler with the 
markup
+               // parser through Application.newMarkupParser().
                if ((autolinking == true) && (analyzeAutolinkCondition(tag) == 
true))
                {
                        // Mark it as autolink enabled
@@ -114,6 +114,8 @@
 
                        // Just a dummy name. The ComponentTag will not be 
forwarded.
                        tag.setId(AUTOLINK_ID);
+                       tag.setAutoComponentTag(true);
+                       tag.setModified(true);
                        return tag;
                }
 
@@ -147,7 +149,8 @@
                                        }
                                        catch (StringValueConversionException e)
                                        {
-                                               throw new 
WicketRuntimeException("Invalid autolink attribute value \"" + autolink + "\"");
+                                               throw new 
WicketRuntimeException("Invalid autolink attribute value \"" +
+                                                               autolink + 
"\"");
                                        }
                                }
                                else if (tag.isClose())
@@ -162,7 +165,7 @@
 
                return tag;
        }
-       
+
        /**
         * Analyze the tag. If return value == true, a autolink component will 
be
         * created.
@@ -195,6 +198,11 @@
                return false;
        }
 
+       /**
+        * 
+        * @param ref
+        * @return
+        */
        private final boolean checkRef(String ref)
        {
                return (ref != null) && (ref.indexOf(":") == -1);

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/WicketMessageTagHandler.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/WicketMessageTagHandler.java?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/WicketMessageTagHandler.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/parser/filter/WicketMessageTagHandler.java
 Wed Aug  8 05:41:50 2007
@@ -60,7 +60,7 @@
         * The id automatically assigned to tags with wicket:message attribute 
but
         * without id
         */
-       public final static String WICKET_MESSAGE_CONTAINER_ID = 
"-message_attr";
+       public final static String WICKET_MESSAGE_CONTAINER_ID = 
"_message_attr_";
 
        /** singleton instance of [EMAIL PROTECTED] AttributeLocalizer} */
        public static final IBehavior ATTRIBUTE_LOCALIZER = new 
AttributeLocalizer();
@@ -83,7 +83,7 @@
                // Get the next tag from the next MarkupFilter in the chain
                // If null, no more tags are available
                final ComponentTag tag = nextComponentTag();
-               if (tag == null)
+               if ((tag == null) || tag.isClose())
                {
                        return tag;
                }
@@ -100,6 +100,8 @@
                                // that wicket will not merge this as raw 
markup and instead
                                // pass it on to a resolver
                                tag.setId(WICKET_MESSAGE_CONTAINER_ID);
+                               tag.setAutoComponentTag(true);
+                               tag.setModified(true);
                        }
                        tag.addBehavior(new AttributeLocalizer());
                }
@@ -138,8 +140,8 @@
                                        if (attrAndKey.length() < 3 || colon < 
1 || colon > attrAndKey.length() - 2)
                                        {
                                                throw new 
WicketRuntimeException(
-                                                               "wicket:message 
attribute contains an invalid value [[" + expr
-                                                                               
+ "]], must be of form (attr:key)+");
+                                                               "wicket:message 
attribute contains an invalid value [[" + expr +
+                                                                               
"]], must be of form (attr:key)+");
                                        }
 
                                        String attr = attrAndKey.substring(0, 
colon);
@@ -164,7 +166,9 @@
 
        /**
         * 
-        * @see 
org.apache.wicket.markup.resolver.IComponentResolver#resolve(org.apache.wicket.MarkupContainer,
 org.apache.wicket.markup.MarkupStream, org.apache.wicket.markup.ComponentTag)
+        * @see 
org.apache.wicket.markup.resolver.IComponentResolver#resolve(org.apache.wicket.MarkupContainer,
+        *      org.apache.wicket.markup.MarkupStream,
+        *      org.apache.wicket.markup.ComponentTag)
         */
        public boolean resolve(MarkupContainer container, MarkupStream 
markupStream, ComponentTag tag)
        {
@@ -175,15 +179,15 @@
                        Component wc = null;
                        if (tag.isOpenClose())
                        {
-                               wc = new 
WebComponent(WICKET_MESSAGE_CONTAINER_ID
-                                               + 
container.getPage().getAutoIndex());
+                               wc = new 
WebComponent(WICKET_MESSAGE_CONTAINER_ID +
+                                               
container.getPage().getAutoIndex());
                        }
                        else
                        {
-                               wc = new 
WebMarkupContainer(WICKET_MESSAGE_CONTAINER_ID
-                                               + 
container.getPage().getAutoIndex());
+                               wc = new 
WebMarkupContainer(WICKET_MESSAGE_CONTAINER_ID +
+                                               
container.getPage().getAutoIndex());
                        }
-                       
+
                        container.autoAdd(wc, markupStream);
                        return true;
                }

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/AutoLinkResolver.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/AutoLinkResolver.java?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/AutoLinkResolver.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/AutoLinkResolver.java
 Wed Aug  8 05:41:50 2007
@@ -141,14 +141,14 @@
 
                private final String anchor;
 
-               /** 
-                * When using <wicket:link> to let Wicket lookup for pages and 
create 
+               /**
+                * When using <wicket:link> to let Wicket lookup for pages and 
create
                 * the related links, it's not possible to change the 
"setAutoEnable"
-                * property, which defaults to true. This affects the prototype 
-                * because, sometimes designers _want_ links to be enabled.
+                * property, which defaults to true. This affects the prototype 
because,
+                * sometimes designers _want_ links to be enabled.
                 */
                public static boolean autoEnable = true;
-               
+
                /**
                 * Construct
                 * 
@@ -219,9 +219,9 @@
 
        /**
         * Encapsulates different aspects of a path. For instance, the path
-        * <code>org.apache.wicket.markup.html.tree.Tree/tree.css</code> has 
extension
-        * <code>css</code>, is relative (absolute == true) and has no page
-        * parameters.
+        * <code>org.apache.wicket.markup.html.tree.Tree/tree.css</code> has
+        * extension <code>css</code>, is relative (absolute == true) and has no
+        * page parameters.
         */
        public static final class PathInfo
        {
@@ -270,7 +270,7 @@
                                infoPath = reference;
                        }
 
-                       this.absolute = (infoPath.startsWith("/") || 
infoPath.startsWith("\\"));
+                       absolute = (infoPath.startsWith("/") || 
infoPath.startsWith("\\"));
 
                        // remove file extension, but remember it
                        String extension = null;
@@ -292,7 +292,7 @@
                                }
                        }
 
-                       this.path = infoPath;
+                       path = infoPath;
                        this.extension = extension;
                        this.anchor = anchor;
                }
@@ -394,8 +394,8 @@
                public Component newAutoComponent(final MarkupContainer 
container, final String autoId,
                                PathInfo pathInfo)
                {
-                       if ((pathInfo.extension != null)
-                                       && 
supportedPageExtensions.contains(pathInfo.extension))
+                       if ((pathInfo.extension != null) &&
+                                       
supportedPageExtensions.contains(pathInfo.extension))
                        {
                                // Obviously a href like 
href="myPkg.MyLabel.html" will do as
                                // well. Wicket will not throw an exception. It 
accepts it.
@@ -433,8 +433,8 @@
 
                                // Make sure base markup pages (inheritance) 
are handled correct
                                MarkupContainer parentWithContainer = 
container.findParentWithAssociatedMarkup();
-                               if ((parentWithContainer instanceof Page) && 
!infoPath.startsWith(".")
-                                               && 
page.getMarkupStream().isMergedMarkup())
+                               if ((parentWithContainer instanceof Page) && 
!infoPath.startsWith(".") &&
+                                               
page.getMarkupStream().isMergedMarkup())
                                {
                                        Class clazz = 
container.getMarkupStream().getTag().getMarkupClass();
                                        if (clazz != null)
@@ -690,7 +690,6 @@
         */
        public AutoLinkResolver()
        {
-
                // register tag reference resolvers
                TagReferenceResolver hrefTagReferenceResolver = new 
TagReferenceResolver("href");
                TagReferenceResolver srcTagReferenceResolver = new 
TagReferenceResolver("src");
@@ -813,6 +812,7 @@
                if (tag.getId() == null)
                {
                        tag.setId(autoId);
+                       tag.setAutoComponentTag(true);
                }
 
                // get the reference resolver

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/ParentResolver.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/ParentResolver.java?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/ParentResolver.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/ParentResolver.java
 Wed Aug  8 05:41:50 2007
@@ -36,21 +36,21 @@
         * Try to resolve the tag, then create a component, add it to the 
container
         * and render it.
         * <p>
-        * Note: Special tags like &ltwicket:...&gt> and tags which id start 
with "_" 
-        * are not resolved.
+        * Note: Special tags like &ltwicket:...&gt> and tags which id start 
with
+        * "_" are not resolved.
         * 
-        * @see 
org.apache.wicket.markup.resolver.IComponentResolver#resolve(MarkupContainer, 
MarkupStream,
-        *      ComponentTag)
+        * @see 
org.apache.wicket.markup.resolver.IComponentResolver#resolve(MarkupContainer,
+        *      MarkupStream, ComponentTag)
         */
        public boolean resolve(final MarkupContainer container, final 
MarkupStream markupStream,
                        final ComponentTag tag)
        {
                // Ignore special tags like _panel, _border, _extend etc.
-               if ((tag instanceof WicketTag) || tag.getId().startsWith("_"))
+               if ((tag instanceof WicketTag) || tag.isAutoComponentTag())
                {
                        return false;
                }
-               
+
                MarkupContainer parent = container;
                while ((parent != null) && (parent.isTransparentResolver()))
                {

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketLinkResolver.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketLinkResolver.java?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketLinkResolver.java
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/resolver/WicketLinkResolver.java
 Wed Aug  8 05:41:50 2007
@@ -25,9 +25,9 @@
 
 /**
  * This is a tag resolver which handles &lt;wicket:link&gt; tags. Because
- * autolinks are already detected and handled, the only task of this
- * resolver will be to add a "transparent" WebMarkupContainer to 
- * transparently handling child components. 
+ * autolinks are already detected and handled, the only task of this resolver
+ * will be to add a "transparent" WebMarkupContainer to transparently handling
+ * child components.
  * 
  * @author Juergen Donnerstag
  */
@@ -39,8 +39,8 @@
         * Try to resolve the tag, then create a component, add it to the 
container
         * and render it.
         * 
-        * @see 
org.apache.wicket.markup.resolver.IComponentResolver#resolve(MarkupContainer, 
MarkupStream,
-        *      ComponentTag)
+        * @see 
org.apache.wicket.markup.resolver.IComponentResolver#resolve(MarkupContainer,
+        *      MarkupStream, ComponentTag)
         * 
         * @param container
         *            The container parsing its markup
@@ -55,25 +55,25 @@
        {
                if (tag instanceof WicketTag)
                {
-                       WicketTag wtag = (WicketTag) tag;
+                       WicketTag wtag = (WicketTag)tag;
                        if (wtag.isLinkTag() && (wtag.getNamespace() != null))
                        {
-                               final String id = "_link_" + 
container.getPage().getAutoIndex();
+                               final String id = tag.getId() + 
container.getPage().getAutoIndex();
                                final Component component = new 
WebMarkupContainer(id)
+                               {
+                                       private static final long 
serialVersionUID = 1L;
+
+                                       /**
+                                        * @see 
org.apache.wicket.MarkupContainer#isTransparentResolver()
+                                        */
+                                       public boolean isTransparentResolver()
                                        {
-                                               private static final long 
serialVersionUID = 1L;
+                                               return true;
+                                       }
+                               };
 
-                                               /**
-                                                * @see 
org.apache.wicket.MarkupContainer#isTransparentResolver()
-                                                */
-                                               public boolean 
isTransparentResolver()
-                                               {
-                                                       return true;
-                                               }
-                                       };
-                               
                                container.autoAdd(component, markupStream);
-       
+
                                // Yes, we handled the tag
                                return true;
                        }

Modified: 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/link/HrefExpectedResult_2.html
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/link/HrefExpectedResult_2.html?view=diff&rev=563840&r1=563839&r2=563840
==============================================================================
--- 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/link/HrefExpectedResult_2.html
 (original)
+++ 
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/markup/html/link/HrefExpectedResult_2.html
 Wed Aug  8 05:41:50 2007
@@ -14,7 +14,7 @@
 -->
 <html>
 <body>
-  <a href="myHref.html"></a>
-  <a href="myHref.html"/>
+  <a href="../myHref.html"></a>
+  <a href="../myHref.html"/>
 </body>
 </html>


Reply via email to