You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by eh...@apache.org on 2007/07/03 23:35:30 UTC

svn commit: r552988 - /incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/ExternalLink.java

Author: ehillenius
Date: Tue Jul  3 14:35:29 2007
New Revision: 552988

URL: http://svn.apache.org/viewvc?view=rev&rev=552988
Log:
remove check on <a. An example of where this check is wrong is with a stylesheet <link used in <wicket:link> tags. If that cannot be resolved, an ExternalLink is created, which then failed when rendering because it is not a <a. Furthermore, I see no reason why ExternalLink couldn't be used with <link directly when people wish to do so.

Modified:
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/ExternalLink.java

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/ExternalLink.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/ExternalLink.java?view=diff&rev=552988&r1=552987&r2=552988
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/ExternalLink.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/link/ExternalLink.java Tue Jul  3 14:35:29 2007
@@ -161,12 +161,13 @@
 					{
 						url = url.substring(1);
 					}
-					url = RequestCycle.get().getRequest().getRelativePathPrefixToContextRoot() + url;
+					url = RequestCycle.get().getRequest().getRelativePathPrefixToContextRoot() +
+							url;
 				}
 
 				// if the tag is an anchor proper
-				if (tag.getName().equalsIgnoreCase("a") || tag.getName().equalsIgnoreCase("link")
-						|| tag.getName().equalsIgnoreCase("area"))
+				if (tag.getName().equalsIgnoreCase("a") || tag.getName().equalsIgnoreCase("link") ||
+						tag.getName().equalsIgnoreCase("area"))
 				{
 					// generate the href attribute
 					tag.put("href", Strings.replaceAll(url, "&", "&amp;"));
@@ -219,10 +220,10 @@
 	 */
 	protected void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag)
 	{
-		this.checkComponentTag(openTag, "a");
 		if ((label != null) && (label.getObject() != null))
 		{
-			replaceComponentTagBody(markupStream, openTag, getModelObjectAsString(label.getObject()));
+			replaceComponentTagBody(markupStream, openTag,
+					getModelObjectAsString(label.getObject()));
 		}
 		else
 		{