tiles-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r513290 - in /tiles/examples/trunk/tiles-showcase/src/main: java/org/apache/tiles/showcase/template/DynTemplateAction.java webapp/common/viewSrcBody.jsp webapp/test/testAll.jsp webapp/tutorial/dynFramesetPage.jsp
Date Thu, 01 Mar 2007 12:00:06 GMT
Author: apetrelli
Date: Thu Mar  1 04:00:04 2007
New Revision: 513290

URL: http://svn.apache.org/viewvc?view=rev&rev=513290
Log:
Various bug fixing for Tiles showcase.

Modified:
    tiles/examples/trunk/tiles-showcase/src/main/java/org/apache/tiles/showcase/template/DynTemplateAction.java
    tiles/examples/trunk/tiles-showcase/src/main/webapp/common/viewSrcBody.jsp
    tiles/examples/trunk/tiles-showcase/src/main/webapp/test/testAll.jsp
    tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/dynFramesetPage.jsp

Modified: tiles/examples/trunk/tiles-showcase/src/main/java/org/apache/tiles/showcase/template/DynTemplateAction.java
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/java/org/apache/tiles/showcase/template/DynTemplateAction.java?view=diff&rev=513290&r1=513289&r2=513290
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/java/org/apache/tiles/showcase/template/DynTemplateAction.java
(original)
+++ tiles/examples/trunk/tiles-showcase/src/main/java/org/apache/tiles/showcase/template/DynTemplateAction.java
Thu Mar  1 04:00:04 2007
@@ -28,7 +28,11 @@
 import org.apache.struts.action.ActionForm;
 import org.apache.struts.action.ActionForward;
 import org.apache.struts.action.ActionMapping;
-import org.apache.tiles.definition.ComponentDefinition;
+import org.apache.tiles.ComponentAttribute;
+import org.apache.tiles.TilesContainer;
+import org.apache.tiles.access.TilesAccess;
+import org.apache.tiles.mgmt.MutableTilesContainer;
+import org.apache.tiles.mgmt.TileDefinition;
 
 
 /**
@@ -64,19 +68,24 @@
 
     System.out.println( "Start dynamic definition" );
       // Create template definition
-    ComponentDefinition definition = new ComponentDefinition();
+    TileDefinition definition = new TileDefinition();
+    definition.setName("templateDefinition");
     String path = "/tutorial";
       // set definition 'contents'
     //definition.setTemplate( "/tutorial/basic/myFramesetLayout.jsp" );
-    definition.put("title", "My first dynamic frameset page", "string", null);
-    definition.put("header", path + "/common/header.jsp", "string", null );
-    definition.put("footer", path + "/common/footer.jsp");
-    definition.put("menu", path + "/basic/menu.jsp");
-    definition.put("body", path + "/basic/helloBody.jsp");
+    definition.addAttribute(new ComponentAttribute("title", "My first dynamic frameset page",
null, "string"));
+    definition.addAttribute(new ComponentAttribute("header", path + "/common/header.jsp",
null, "string"));
+    definition.addAttribute(new ComponentAttribute("footer", path + "/common/footer.jsp",
null, "string"));
+    definition.addAttribute(new ComponentAttribute("menu", path + "/basic/menu.jsp", null,
"string"));
+    definition.addAttribute(new ComponentAttribute("body", path + "/basic/helloBody.jsp",
null, "string"));
 
     System.out.println( "definition=" + definition );
       // Save our definition as a bean :
-    request.setAttribute( "templateDefinition", definition );
+    TilesContainer container = TilesAccess.getContainer(request
+                .getSession().getServletContext());
+    if (container != null && container instanceof MutableTilesContainer) {
+        ((MutableTilesContainer) container).register(definition, request, response);
+    }
 
 	  return (mapping.findForward("success"));
     }

Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/common/viewSrcBody.jsp
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/common/viewSrcBody.jsp?view=diff&rev=513290&r1=513289&r2=513290
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/common/viewSrcBody.jsp (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/common/viewSrcBody.jsp Thu Mar  1
04:00:04 2007
@@ -34,7 +34,7 @@
 
   <%-- Import component attributes, if any.
    --%>
-   HELLO!!!
+   
 
 <tiles:importAttribute/>
 
@@ -47,8 +47,8 @@
 
 <logic:present name="srcPath" >
 <bean:define id="srcPathVar" name="srcPath" type="java.lang.String"/>
+<bean:resource id="src" name="<%=srcPathVar%>" />
 <strong>file '<%=srcPathVar%>'</strong>
-<%--<bean:resource id="src" name="<%=srcPathVar%>" /> --%>
 <br>
 <pre>
 <bean:write filter="true" name="src" scope="page"/>

Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/test/testAll.jsp
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/test/testAll.jsp?view=diff&rev=513290&r1=513289&r2=513290
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/test/testAll.jsp (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/test/testAll.jsp Thu Mar  1 04:00:04
2007
@@ -32,7 +32,7 @@
 <td><strong>Sources</strong></td>
 </tr>
 <tr>
-    <td valign="top"><tiles:insertTemplate template="testBasic.jsp" /></td>
+    <td valign="top"><tiles:insertTemplate template="/test/testBasic.jsp" /></td>
     <td valign="top">
 	  <tiles:insertTemplate template="/common/viewSrcBody.jsp">
 	    <tiles:putAttribute name="srcPath" value="/test/testBasic.jsp" />
@@ -40,7 +40,7 @@
 	</td>
 </tr>
 <tr>
-    <td valign="top"><tiles:insertTemplate template="testList.jsp" /></td>
+    <td valign="top"><tiles:insertTemplate template="/test/testList.jsp" /></td>
     <td valign="top">
 	  <tiles:insertTemplate template="/common/viewSrcBody.jsp">
 	    <tiles:putAttribute name="srcPath" value="/test/testList.jsp" />
@@ -48,7 +48,7 @@
 	</td>
 </tr>
 <tr>
-    <td valign="top"><tiles:insertTemplate template="testDefinitions.jsp" /></td>
+    <td valign="top"><tiles:insertTemplate template="/test/testDefinitions.jsp"
/></td>
     <td valign="top">
 	  <tiles:insertTemplate template="/common/viewSrcBody.jsp">
 	    <tiles:putAttribute name="srcPath" value="/test/testDefinitions.jsp" />

Modified: tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/dynFramesetPage.jsp
URL: http://svn.apache.org/viewvc/tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/dynFramesetPage.jsp?view=diff&rev=513290&r1=513289&r2=513290
==============================================================================
--- tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/dynFramesetPage.jsp (original)
+++ tiles/examples/trunk/tiles-showcase/src/main/webapp/tutorial/dynFramesetPage.jsp Thu Mar
 1 04:00:04 2007
@@ -23,11 +23,12 @@
 --%>
 <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
 
-<tiles:insertDefinition template="/tutorial/basic/myFramesetLayout.jsp" definition="templateDefinition"
 >
+<tiles:definition name="framesetDefinition" extends="templateDefinition" template="/tutorial/basic/myFramesetLayout.jsp">
   <%--  Uncomment lines to overload parameters --%>
   <%-- <tiles:putAttribute name="title"  content="My first frameset page" direct="true"
/> --%>
   <%-- <tiles:putAttribute name="header" content="/tutorial/common/header.jsp" direct="true"/>
--%>
   <%-- <tiles:putAttribute name="footer" content="/tutorial/common/footer.jsp" direct="true"/>
--%>
   <%-- <tiles:putAttribute name="menu"   content="/tutorial/basic/menu.jsp" direct="true"/>
--%>
   <%-- <tiles:putAttribute name="body"   content="/tutorial/basic/helloBody.jsp" direct="true"/>
--%>
-</tiles:insertDefinition>
+</tiles:definition>
+<tiles:insertDefinition name="framesetDefinition" />



Mime
View raw message