You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2009/02/07 23:11:01 UTC

svn commit: r741971 - in /tiles/sandbox/trunk/tiles-test-sandbox: pom.xml src/main/java/org/apache/tiles/test/factory/TestTilesContainerFactory.java src/main/webapp/WEB-INF/web.xml src/main/webapp/layout.ftl

Author: apetrelli
Date: Sat Feb  7 22:11:00 2009
New Revision: 741971

URL: http://svn.apache.org/viewvc?rev=741971&view=rev
Log:
TILESSB-5
Using native FreeMarker support instead of JSP support. The "layout.ftl" is evaluated correctly. The path seems right :-)

Modified:
    tiles/sandbox/trunk/tiles-test-sandbox/pom.xml
    tiles/sandbox/trunk/tiles-test-sandbox/src/main/java/org/apache/tiles/test/factory/TestTilesContainerFactory.java
    tiles/sandbox/trunk/tiles-test-sandbox/src/main/webapp/WEB-INF/web.xml
    tiles/sandbox/trunk/tiles-test-sandbox/src/main/webapp/layout.ftl

Modified: tiles/sandbox/trunk/tiles-test-sandbox/pom.xml
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-test-sandbox/pom.xml?rev=741971&r1=741970&r2=741971&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-test-sandbox/pom.xml (original)
+++ tiles/sandbox/trunk/tiles-test-sandbox/pom.xml Sat Feb  7 22:11:00 2009
@@ -48,6 +48,11 @@
          <version>2.1.3-SNAPSHOT</version>
       </dependency>
       <dependency>
+         <groupId>${pom.groupId}</groupId>
+         <artifactId>tiles-freemarker</artifactId>
+         <version>1.0-SNAPSHOT</version>
+      </dependency>
+      <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
          <version>2.5</version>

Modified: tiles/sandbox/trunk/tiles-test-sandbox/src/main/java/org/apache/tiles/test/factory/TestTilesContainerFactory.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-test-sandbox/src/main/java/org/apache/tiles/test/factory/TestTilesContainerFactory.java?rev=741971&r1=741970&r2=741971&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-test-sandbox/src/main/java/org/apache/tiles/test/factory/TestTilesContainerFactory.java (original)
+++ tiles/sandbox/trunk/tiles-test-sandbox/src/main/java/org/apache/tiles/test/factory/TestTilesContainerFactory.java Sat Feb  7 22:11:00 2009
@@ -37,6 +37,7 @@
 import org.apache.tiles.TilesApplicationContext;
 import org.apache.tiles.TilesContainer;
 import org.apache.tiles.compat.definition.digester.CompatibilityDigesterDefinitionsReader;
+import org.apache.tiles.context.ChainedTilesRequestContextFactory;
 import org.apache.tiles.context.TilesRequestContextFactory;
 import org.apache.tiles.definition.DefinitionsFactoryException;
 import org.apache.tiles.definition.DefinitionsReader;
@@ -45,6 +46,7 @@
 import org.apache.tiles.evaluator.el.TilesContextBeanELResolver;
 import org.apache.tiles.evaluator.el.TilesContextELResolver;
 import org.apache.tiles.factory.BasicTilesContainerFactory;
+import org.apache.tiles.freemarker.context.FreeMarkerTilesRequestContextFactory;
 import org.apache.tiles.impl.BasicTilesContainer;
 import org.apache.tiles.impl.mgmt.CachingTilesContainer;
 import org.apache.tiles.locale.LocaleResolver;
@@ -70,6 +72,27 @@
             TilesApplicationContext applicationContext) {
         return new CachingTilesContainer();
     }
+    /**
+     * Register elements of a chained request context factory.
+     *
+     * @param contextFactory The request context factory to use.
+     * @since 2.1.1
+     */
+    protected void registerChainedRequestContextFactories(
+            ChainedTilesRequestContextFactory contextFactory) {
+        List<TilesRequestContextFactory> factories = new ArrayList<TilesRequestContextFactory>(
+                3);
+        registerRequestContextFactory(
+                "org.apache.tiles.servlet.context.ServletTilesRequestContextFactory",
+                factories, contextFactory);
+        registerRequestContextFactory(
+                "org.apache.tiles.jsp.context.JspTilesRequestContextFactory",
+                factories, contextFactory);
+        registerRequestContextFactory(
+                FreeMarkerTilesRequestContextFactory.class.getName(),
+                factories, contextFactory);
+        contextFactory.setFactories(factories);
+    }
 
     /** {@inheritDoc} */
     @Override

Modified: tiles/sandbox/trunk/tiles-test-sandbox/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-test-sandbox/src/main/webapp/WEB-INF/web.xml?rev=741971&r1=741970&r2=741971&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-test-sandbox/src/main/webapp/WEB-INF/web.xml (original)
+++ tiles/sandbox/trunk/tiles-test-sandbox/src/main/webapp/WEB-INF/web.xml Sat Feb  7 22:11:00 2009
@@ -75,7 +75,7 @@
     <!-- Standard Action Servlet Configuration -->
     <servlet>
         <servlet-name>freemarker</servlet-name>
-        <servlet-class>freemarker.ext.servlet.FreemarkerServlet</servlet-class>
+        <servlet-class>org.apache.tiles.freemarker.servlet.TilesFreemarkerServlet</servlet-class>
         
         <!-- FreemarkerServlet settings: -->
         <init-param>

Modified: tiles/sandbox/trunk/tiles-test-sandbox/src/main/webapp/layout.ftl
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles-test-sandbox/src/main/webapp/layout.ftl?rev=741971&r1=741970&r2=741971&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles-test-sandbox/src/main/webapp/layout.ftl (original)
+++ tiles/sandbox/trunk/tiles-test-sandbox/src/main/webapp/layout.ftl Sat Feb  7 22:11:00 2009
@@ -21,17 +21,15 @@
  *
  */
 -->
-<#assign tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]>
-
 <table  border="2"  width="300"  bordercolor="Gray">
   <tr>
-    <td  bgcolor="Blue"><strong><@tiles.getAsString name="title"/></strong></td>
+    <td  bgcolor="Blue"><strong><@getAsString name="title"/></strong></td>
   </tr>
   <tr>
-    <td><@tiles.insertAttribute name="header"/></td>
+    <td><@insertAttribute name="header"/></td>
   </tr>
   <tr>
-    <td><@tiles.insertAttribute name="body"/></td>
+    <td><@insertAttribute name="body"/></td>
   </tr>
   <tr>
     <td>This layout is made in FreeMarker.</td>