Author: knopp
Date: Tue Nov 20 18:23:43 2007
New Revision: 596905

URL: http://svn.apache.org/viewvc?rev=596905&view=rev
Log:
WICKET-1174

Modified:
    wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java

Modified: 
wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java?rev=596905&r1=596904&r2=596905&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java 
(original)
+++ wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/Component.java 
Tue Nov 20 18:23:43 2007
@@ -43,6 +43,7 @@
 import org.apache.wicket.model.IModelComparator;
 import org.apache.wicket.model.IWrapModel;
 import org.apache.wicket.model.LoadableDetachableModel;
+import org.apache.wicket.protocol.http.WebRequest;
 import org.apache.wicket.settings.IDebugSettings;
 import org.apache.wicket.util.convert.IConverter;
 import org.apache.wicket.util.lang.Classes;
@@ -1406,8 +1407,8 @@
                        return (String)storedMarkupId;
                }
 
-               final int generatedMarkupId = storedMarkupId instanceof Integer 
? ((Integer)storedMarkupId)
-                       .intValue() : nextAutoIndex();
+               final int generatedMarkupId = storedMarkupId instanceof Integer
+                       ? ((Integer)storedMarkupId).intValue() : 
nextAutoIndex();
 
                if (storedMarkupId == null)
                {
@@ -2380,14 +2381,13 @@
                if (!tag.isOpenClose() && !tag.isOpen())
                {
                        // We were something other than <tag> or <tag/>
-                       markupStream
-                               .throwMarkupException("Method renderComponent 
called on bad markup element: " + tag);
+                       markupStream.throwMarkupException("Method 
renderComponent called on bad markup element: " +
+                               tag);
                }
 
                if (tag.isOpenClose() && openTag.isOpen())
                {
-                       markupStream
-                               .throwMarkupException("You can not modify a 
open tag to open-close: " + tag);
+                       markupStream.throwMarkupException("You can not modify a 
open tag to open-close: " + tag);
                }
 
                try
@@ -2421,8 +2421,12 @@
                                        // rendered.
                                        if (getRenderBodyOnly() == false)
                                        {
-                                               final boolean stripWicketTags = 
Application.get().getMarkupSettings()
-                                                       .getStripWicketTags();
+                                               final boolean ajaxRequest = 
getRequest() instanceof WebRequest &&
+                                                       
((WebRequest)getRequest()).isAjax();
+
+                                               final boolean stripWicketTags = 
ajaxRequest ||
+                                                       
Application.get().getMarkupSettings().getStripWicketTags();
+
                                                if (!(openTag instanceof 
WicketTag) || !stripWicketTags)
                                                {
                                                        // Close the manually 
opened panel tag.
@@ -2989,11 +2993,19 @@
                        }
                        else
                        {
-                               return new StringBuffer("[Component id = 
").append(getId()).append(", page = ")
-                                       
.append(getPage().getClass().getName()).append(", path = ").append(getPath())
-                                       
.append(".").append(Classes.simpleName(getClass())).append(", isVisible = ")
-                                       .append((isRenderAllowed() && 
isVisible())).append(", isVersioned = ").append(
-                                               
isVersioned()).append("]").toString();
+                               return new StringBuffer("[Component id = 
").append(getId())
+                                       .append(", page = ")
+                                       .append(getPage().getClass().getName())
+                                       .append(", path = ")
+                                       .append(getPath())
+                                       .append(".")
+                                       .append(Classes.simpleName(getClass()))
+                                       .append(", isVisible = ")
+                                       .append((isRenderAllowed() && 
isVisible()))
+                                       .append(", isVersioned = ")
+                                       .append(isVersioned())
+                                       .append("]")
+                                       .toString();
                        }
                }
                else
@@ -3686,7 +3698,12 @@
         */
        protected final void renderComponentTag(ComponentTag tag)
        {
-               final boolean stripWicketTags = 
Application.get().getMarkupSettings().getStripWicketTags();
+               final boolean ajaxRequest = getRequest() instanceof WebRequest 
&&
+                       ((WebRequest)getRequest()).isAjax();
+
+               final boolean stripWicketTags = ajaxRequest ||
+                       
Application.get().getMarkupSettings().getStripWicketTags();
+
                if (!(tag instanceof WicketTag) || !stripWicketTags)
                {
                        // Apply behavior modifiers
@@ -3720,9 +3737,7 @@
                        }
 
                        // Write the tag
-                       tag
-                               .writeOutput(getResponse(), stripWicketTags, 
findMarkupStream()
-                                       .getWicketNamespace());
+                       tag.writeOutput(getResponse(), stripWicketTags, 
findMarkupStream().getWicketNamespace());
                }
        }
 


Reply via email to