struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r436762 - /struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertTag.java
Date Fri, 25 Aug 2006 11:36:35 GMT
Author: apetrelli
Date: Fri Aug 25 04:36:32 2006
New Revision: 436762

URL: http://svn.apache.org/viewvc?rev=436762&view=rev
Log:
SB-27
A modified version of the patch has been applied: I used "template" instead of "page" as suggested
by Greg Reddin.

Modified:
    struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertTag.java

Modified: struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertTag.java
URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertTag.java?rev=436762&r1=436761&r2=436762&view=diff
==============================================================================
--- struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertTag.java
(original)
+++ struts/sandbox/trunk/tiles/tiles-core/src/main/java/org/apache/tiles/taglib/InsertTag.java
Fri Aug 25 04:36:32 2006
@@ -590,8 +590,22 @@
             
             String type = value.getType();
             if (type == null) {
-                // FIXME
-                return null;
+                Object valueContent = value.getValue();
+                if (valueContent instanceof String) {
+                    String valueString = (String) valueContent;
+                    if (valueString.startsWith("/")) {
+                        type = "template";
+                    } else {
+                        type = "string";
+                    }
+                } else if (valueContent instanceof ComponentDefinition) {
+                    type = "definition";
+                }
+            }
+            
+            if (type == null) {
+                throw new JspException("Unrecognized type for attribute value "
+                + value.getValue());
             }
             
             if (type.equalsIgnoreCase("string")) {



Mime
View raw message