freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [3/3] incubator-freemarker git commit: Deleted examples. They weren't maintained much. Anyway, if we want examples, that should be done on GitHub for example. Putting them into the releases doesn't make much sense.
Date Sat, 02 Jan 2016 15:06:59 GMT
Deleted examples. They weren't maintained much. Anyway, if we want examples, that should be
done on GitHub for example. Putting them into the releases doesn't make much sense.


Project: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/commit/19c2b987
Tree: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/tree/19c2b987
Diff: http://git-wip-us.apache.org/repos/asf/incubator-freemarker/diff/19c2b987

Branch: refs/heads/2.3-gae
Commit: 19c2b98739b68e5e8fc6bc463a2ddb59f3a10385
Parents: def5937
Author: ddekany <ddekany@apache.org>
Authored: Sat Jan 2 16:06:30 2016 +0100
Committer: ddekany <ddekany@apache.org>
Committed: Sat Jan 2 16:06:30 2016 +0100

----------------------------------------------------------------------
 build.xml                                       |   75 -
 src/examples/README.txt                         |   39 -
 src/examples/ant/README.txt                     |   24 -
 src/examples/ant/build.xml                      |   34 -
 src/examples/ant/src/template/faq2html.ftl      |   51 -
 src/examples/ant/src/xml/faq.xml                |  221 --
 .../WEB-INF/classes/example/AddAction.java      |   45 -
 .../example/ApplicationResources.properties     |   22 -
 .../WEB-INF/classes/example/FormAction.java     |   37 -
 .../classes/example/GuestbookAction.java        |   34 -
 .../classes/example/GuestbookActionServlet.java |   39 -
 .../WEB-INF/classes/example/GuestbookEntry.java |   45 -
 .../classes/example/GuestbookEntryForm.java     |   73 -
 .../WEB-INF/classes/example/IndexAction.java    |   42 -
 .../struts-webapp/WEB-INF/struts-config.xml     |   60 -
 .../struts-webapp/WEB-INF/struts-html.tld       | 2934 ------------------
 src/examples/struts-webapp/WEB-INF/web.xml      |  125 -
 src/examples/struts-webapp/add.ftl              |   32 -
 src/examples/struts-webapp/form.ftl             |   39 -
 src/examples/struts-webapp/help.html            |   43 -
 src/examples/struts-webapp/index.ftl            |   41 -
 src/examples/struts-webapp/lib/common.ftl       |   39 -
 src/examples/struts-webapp/poweredby_ffffff.png |  Bin 2775 -> 0 bytes
 .../WEB-INF/classes/example/HelloServlet.java   |   80 -
 src/examples/webapp1/WEB-INF/templates/test.ftl |   26 -
 src/examples/webapp1/WEB-INF/web.xml            |   38 -
 src/examples/webapp1/help.html                  |   39 -
 .../classes/example/ControllerServlet.java      |  148 -
 .../WEB-INF/classes/example/GuestbookEntry.java |   45 -
 .../classes/example/GuestbookServlet.java       |   97 -
 .../webapp2/WEB-INF/classes/example/Page.java   |   67 -
 src/examples/webapp2/WEB-INF/templates/add.ftl  |   32 -
 src/examples/webapp2/WEB-INF/templates/form.ftl |   44 -
 .../webapp2/WEB-INF/templates/index.ftl         |   42 -
 .../webapp2/WEB-INF/templates/lib/common.ftl    |   39 -
 src/examples/webapp2/WEB-INF/web.xml            |   38 -
 src/examples/webapp2/help.html                  |   84 -
 src/examples/webapp2/poweredby_ffffff.png       |  Bin 2775 -> 0 bytes
 38 files changed, 4913 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/19c2b987/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 06dc5eb..1d9769e 100644
--- a/build.xml
+++ b/build.xml
@@ -69,18 +69,6 @@
     property="boot.classpath.j2se1.6.correct"
   />
   
-  <condition property="example.freemarker.jar.location"
-    value="freemarker.jar" else="build/freemarker.jar">
-    <and>
-      <available  file="freemarker.jar" />
-      <not>
-        <available  file="build/freemarker.jar" />
-      </not>
-    </and>
-  </condition>
-  
-  <available file="lib/struts" property="struts.available" />
-  
   <!-- Set up version/timestamp filters and the version property: -->
   <tstamp>
     <format property="timestampNice" pattern="yyyy-MM-dd'T'HH:mm:ss'Z'"
@@ -598,69 +586,6 @@
     <u:manual offline="false" locale="zh_CN" />
   </target>
   
-  <!-- ====================== -->
-  <!-- Examples               -->
-  <!-- ====================== -->
-
-  <macrodef name="buildExampleWebapp" uri="http://freemarker.org/util">
-    <attribute name="exampleName" />
-    <sequential>
-      <mkdir dir="build/examples/@{exampleName}/WEB-INF/classes" />
-      <ivy:cachepath conf="example.@{exampleName}" pathid="ivy.dep" />
-      <javac
-        srcdir="src/examples/@{exampleName}/WEB-INF/classes"
-        destdir="build/examples/@{exampleName}/WEB-INF/classes"
-        deprecation="off" debug="on" optimize="off" target="1.5" source="1.5"
-        encoding="utf-8"
-        includeantruntime="false"
-        classpathref="ivy.dep"
-        bootclasspath="${boot.classpath.j2se1.5}"
-      >
-        <classpath>
-          <pathelement path="${ivy.dep}" />
-          <pathelement location="${example.freemarker.jar.location}" />
-          <fileset dir="lib/struts" erroronmissingdir="false">
-            <include name="*.jar" />
-          </fileset>
-        </classpath>
-      </javac>
-      <copy toDir="build/examples/@{exampleName}">
-        <fileset dir="src/examples/@{exampleName}" excludes="**/*.java" />
-      </copy>
-      <copy file="${example.freemarker.jar.location}"
-        todir="build/examples/@{exampleName}/WEB-INF/lib" />
-      <echo message="*** Example built: build/examples/@{exampleName} ***" />
-    </sequential>
-  </macrodef>
-  
-  <target name="example-webapp1" depends="jar" description="Build example webapp 1">
-    <u:buildExampleWebapp examplename="webapp1" />
-  </target>
-
-  <target name="example-webapp2" depends="jar" description="Build example webapp 2">
-    <u:buildExampleWebapp examplename="webapp2" />
-  </target>
-
-  <target name="example-struts-webapp" depends="jar" description="Build example Struts
1 webapp">
-    <fail unless="struts.available"><!--
-      -->You have to copy the Struts 1.1 jar-s to <!--
-      -->&lt;freemarker_project>/lib/struts to build this example!<!--
-    --></fail>
-    <copy todir="build/examples/struts-webapp/WEB-INF/lib">
-      <fileset dir="lib/struts" />
-    </copy>
-    <u:buildExampleWebapp examplename="struts-webapp" />
-  </target>
-  
-  <target name="example-ant" depends="jar" description="Build Ant example">
-    <mkdir dir="build/examples/ant" />
-    <copy toDir="build/examples/ant">
-      <fileset dir="src/examples/ant" />
-    </copy>
-    <copy file="${example.freemarker.jar.location}"
-      todir="build/examples/ant/lib" />
-    <echo message="*** Example built: build/examples/ant ***" />
-  </target>
 
   <!-- ====================== -->
   <!-- Distributuion building -->

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/19c2b987/src/examples/README.txt
----------------------------------------------------------------------
diff --git a/src/examples/README.txt b/src/examples/README.txt
deleted file mode 100644
index 437cd28..0000000
--- a/src/examples/README.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- 
-Examples
-========
-
-Examples for using FreeMarker (FM):
-
-webapp1        Building Web app. framework around FM, step 1: Hello World!
-webapp2        Building Web app. framework around FM, step 2: Guest-book
-struts-webapp  Using FM in a Model-2 framework (Struts 1.1) with JSP taglibs
-ant            Demonstrates the FreeMarker XML transform Ant-task
-
-To build the example webapps, you need Ant (http://ant.apache.org/) and run
-the following commands from the base FreeMarker directory:
-
-  ant example-<example-name>
-
-where <example-name> is the name of the example as struts-webapp or webapp1.
-The built Web applications will be in the build/examples directory.
-
-For more information read the help.html or README.txt in the directory of
-examples.

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/19c2b987/src/examples/ant/README.txt
----------------------------------------------------------------------
diff --git a/src/examples/ant/README.txt b/src/examples/ant/README.txt
deleted file mode 100644
index 5ac811c..0000000
--- a/src/examples/ant/README.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- 
-Issue ant from this directory, and it will create an out directory with HTLM
-in it.
-
-You should do this in the already built example, not inside the
-src/examples/ant directory!

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/19c2b987/src/examples/ant/build.xml
----------------------------------------------------------------------
diff --git a/src/examples/ant/build.xml b/src/examples/ant/build.xml
deleted file mode 100644
index b60a2cb..0000000
--- a/src/examples/ant/build.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-  
-    http://www.apache.org/licenses/LICENSE-2.0
-  
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project name="FreeMarker-FAQ" default="generate" basedir=".">
-  <taskdef
-      name="freemarker"
-      classname="freemarker.ext.ant.FreemarkerXmlTask"
-      classpath="lib/freemarker.jar" />
-
-  <target name="generate">
-    <mkdir dir="html" />
-    <freemarker
-        basedir="src/xml"
-        destdir="out"
-        includes="**/*.xml"
-        template="src/template/faq2html.ftl" />
-  </target>
-    
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/19c2b987/src/examples/ant/src/template/faq2html.ftl
----------------------------------------------------------------------
diff --git a/src/examples/ant/src/template/faq2html.ftl b/src/examples/ant/src/template/faq2html.ftl
deleted file mode 100644
index fb6a8ca..0000000
--- a/src/examples/ant/src/template/faq2html.ftl
+++ /dev/null
@@ -1,51 +0,0 @@
-<#--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-  
-    http://www.apache.org/licenses/LICENSE-2.0
-  
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<#escape x as x?html>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
-  <head>
-    <title>${.node.faq.@title}</title>
-    <meta name="keywords" content="FreeMarker, Java, servlet, HTML, template, free software,
open source, XML" />
-  </head>
-  <body bgcolor="#ffffff">
-    <h2><a name="top">${.node.faq.@title}</a></h2>
-    <#noescape>${.node.faq.preface.@@markup}</#noescape>
-    <h3>Table of contents</h3>
-
-    <#list .node.faq.topicgroup as topicgroup>
-      <h4>${topicgroup.@name}</h4>
-      <ul>
-      <#list topicgroup.topic as topic>
-        <li><a href="#${topic.@id}">${topic.@name}</a></li>
-      </#list>
-      </ul>
-    </#list>
-
-    <p>If your question was not answered by this FAQ, write to
-    <a href="mailto:${.node.faq.@adminMailTo}">${.node.faq.@adminName}</a>
-    (the current maintainer).</p>
-    <#list .node.faq.topicgroup.topic as topic>
-      <hr />
-      <h3><a name="${topic.@id}">${topic.@name}</a></h3>
-        <#noescape>${topic.@@nested_markup}</#noescape>
-      <p><a href="#top">Back to top</a></p>
-    </#list>
-  </body>
-</html>
-</#escape>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/19c2b987/src/examples/ant/src/xml/faq.xml
----------------------------------------------------------------------
diff --git a/src/examples/ant/src/xml/faq.xml b/src/examples/ant/src/xml/faq.xml
deleted file mode 100644
index d201a7f..0000000
--- a/src/examples/ant/src/xml/faq.xml
+++ /dev/null
@@ -1,221 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-  
-    http://www.apache.org/licenses/LICENSE-2.0
-  
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<faq title="The Old FreeMarker FAQ" adminMailTo="run2000@users.sourceforge.net" adminName="Nicholas
Cull">
-  <preface/>
-  <topicgroup name="Assembling template data models">
-    <topic id="basic" name="Can you give me some examples showing how to assemble a template
data model?">
-<p>The easiest way is to use <tt>SimpleHash</tt>, <tt>SimpleList</tt>,
and 
-<tt>SimpleScalar</tt>. For example, suppose you want to be able to use a 
-variable called <tt>foo.bar.baz.bing</tt> in your template. You could make a

-structure of nested <tt>SimpleHash</tt> objects like this: </p>
-<pre>SimpleHash foo = new SimpleHash();
-SimpleHash bar = new SimpleHash();
-SimpleHash baz = new SimpleHash();
-SimpleScalar bing = new SimpleScalar("value of bing");
-baz.put("bing", bing);
-bar.put("baz", baz);
-foo.put("bar", bar);
-modelRoot.put("foo", foo);
-</pre>
-<p>What about nested lists? Suppose you wanted to write something like this in a 
-template: </p>
-<pre>&lt;list list1 as list2&gt;
-    &lt;list list2 as list3&gt;
-        &lt;list list3 as element&gt;
-            ${element}&lt;br&gt;
-        &lt;/list&gt;
-    &lt;/list&gt;
-&lt;/list&gt;
-</pre>
-<p>You could make nested <tt>SimpleList</tt>s like this: </p>
-<pre>SimpleList list1 = new SimpleList();
-for (int i = 0; i &lt; 3; i++) {
-    SimpleList list2 = new SimpleList();
-    for (int j = 0; j &lt; 3; j++) {
-        SimpleList list3 = new SimpleList();
-        for (int k = 0; k &lt; 3; k++) {
-            list3.add(new SimpleScalar("test " +
-                                       String.valueOf(i) +
-                                       " " +
-                                       String.valueOf(j) +
-                                       " " +
-                                       String.valueOf(k)));
-        }
-        list2.add(list3);
-    }
-    list1.add(list2);
-}
-
-modelRoot.put("list1", list1);
-</pre>
-<p>The template code above would then produce this output: </p>
-<p>test 0 0 0<br />test 0 0 1<br />test 0 0 2<br />test 0 1 0<br
/>test 0 1 1<br />test 0 
-1 2<br />test 0 2 0<br />test 0 2 1<br />test 0 2 2<br />test 1 0
0<br />test 1 0 
-1<br />test 1 0 2<br />test 1 1 0<br /></p>
-<p>etc.</p> 
-    </topic>
-    <topic id="xml" name="Can I use XML documents as data models?">
-      <p>Yes, you can. In particular, you have to first build a <a href="http://www.jdom.org/"
target="_top">JDOM</a> tree
-      from your XML document, and afterwards you can use JDOM tree nodes as data models.
-      The extensions library has a class that can wrap a JDOM nodes to expose them to FreeMarker
as
-      a template model. In order to wrap your JDOM document tree in a freemarker TemplateModel,
it is 
-      sufficient to do the following:</p>
-      <pre>
-...
-org.jdom.Document document = getMyDocumentSomehow(...);
-TemplateModel model = new freemarker.ext.jdom.NodeListModel(document);
-...
-      </pre>
-      <p>In the example below, the templates will be able to access the XML document
through the 
-      "document" variable. The adapter supports all kinds of tree traversals and filterings,
-      allows use of a node list as a TemplateListModel, and outputs XML fragments of contained
nodes 
-      when used as a string literal. It also features full XPath support.</p>
-      <p>This FAQ page itself is created by applying a FreeMarker template to an XML
document. Table
-      of contents with links, topic grouping, and "Back to top" are all generated by the
template.
-      See the <tt>examples/jdom</tt> and <tt>examples/ant</tt>
-      directories in FreeMarker distribution for example on using the XML support.</p>
-    </topic>
-    <topic id="reflect" name="What's a good way to wrap an existing object so that a template
can call its methods?">
-      <p>The extensions library has classes to wrap arbitrary Java objects
-      as data models. In general, all you need to do to wrap your object <tt>obj</tt>
into
-      a TemplateModel is to call a single static factory method:</p>
-      <pre>
-...
-TemplateModel model = freemarker.ext.beans.ReflectionUtilities.wrap(obj);
-...
-      </pre>
-      <p>After this, you can write arbitrary method calls on the wrapped object, i.e.
you
-      can write <tt>${obj.getFoo()}</tt> in a template to execute method foo
and place its
-      result in the template output. Extensions library uses the JavaBeans introspector to
discover available
-      methods, so you can use bean property-style invocations as well: in previous example
you could 
-      have written <tt>${obj.foo}</tt> as well. If any property or method call
returns an object,
-      it is automatically wrapped for you, so you can chain invocations: <tt>{$obj.bar.baz.bing}</tt>
-      would translate to what in Java would be <tt>obj.getBar().getBaz().getBing()</tt>.
-      The framework automatically recognizes arrays as well as iterators, maps and collections
-      from <tt>java.util</tt> package and provides them with additional capabilities
(arrays,
-      iterators, and collections act as list models and maps act as both lists of their entries
-      and allow lookup when used as a method model). There is even a facility for invoking
-      static methods (in case you ever needed <tt>System.currentTimeMillis()</tt>
in a template).</p>
-      <p>It is worth noting that the framework caches the results of introspection,
so that 
-      the negative performance impact resulting from reflected method lookup is minimized.</p>
-      <p>For example on using the reflection wrapper, see the <tt>examples/webapp</tt>
-      directory in the FreeMarker distribution.</p>
-    </topic>
-  </topicgroup>
-  <topicgroup name="Integration">
-    <topic id="servlet" name="Is there a HTTP servlet for FreeMarker I can use out-of-the-box?">
-      <p>Yes, there is. The extensions library has the class <tt>freemarker.ext.servlet.FreemarkerServlet</tt>
-      that you can use to provide template processing capabilities to your webapp. There
is even a sample
-      webapp under the <tt>examples/webapp</tt> directory of the distribution
that should get you started.</p>
-      <p>In general, you should only place the following inside your <tt>web.xml</tt>
file:</p>
-<pre>
-  &lt;servlet&gt;
-    &lt;servlet-name&gt;freemarker&lt;/servlet-name&gt;
-    &lt;servlet-class&gt;freemarker.ext.servlet.FreemarkerServlet&lt;/servlet-class&gt;
-    &lt;init-param&gt;
-      &lt;param-name&gt;TemplatePath&lt;/param-name&gt;
-      &lt;param-value&gt;/templates&lt;/param-value&gt;
-    &lt;/init-param&gt;
-    &lt;init-param&gt;
-      &lt;param-name&gt;TemplateDelay&lt;/param-name&gt;
-      &lt;param-value&gt;0&lt;/param-value&gt;
-    &lt;/init-param&gt;
-    &lt;init-param&gt;
-      &lt;param-name&gt;NoCache&lt;/param-name&gt;
-      &lt;param-value&gt;true&lt;/param-value&gt;
-    &lt;/init-param&gt;
-    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
-  &lt;/servlet&gt;
-
-  &lt;servlet-mapping&gt;
-    &lt;servlet-name&gt;freemarker&lt;/servlet-name&gt;
-    &lt;url-pattern&gt;/templates/*&lt;/url-pattern&gt;
-  &lt;/servlet-mapping&gt;
-</pre>
-    <p>This will map all URLs beginning with /templates/ to templates in your <tt>webapp/templates</tt>
directory.
-    The servlet readily provides access to ServletContext, HttpSession, HttpServletRequest
and HttpServletRequest 
-    parameters in the template data model. If you need to have additional variables available
in your data model, 
-    just subclass the servlet and override the <tt>preTemplateProcess()</tt>
method to shove any additional data
-    you need into the model before the template gets processed.</p>
-    </topic>
-    <topic id="ant" name="Can I use FreeMarker template processing in Ant?">
-      <p>Yes, you can. In particular, there is a FreeMarker task for Ant that will
get a set of XML
-      files, run them through a FreeMarker template, and output the resulting files in a
target 
-      directory. This method is ideal for generating documentation, SQL scripts, or any other
-      transformation requried during your build process. It is a viable alternative to Ant's
-      <tt>xslt</tt> task. The Ant task is part of the extensions library. See
the <tt>examples/ant</tt>
-      directory in FreeMarker distribution for a sample <tt>build.xml</tt> file
that employs FreeMarker.</p>
-    </topic>
-  </topicgroup>
-  <topicgroup name="Features">
-    <topic id="arithmetic" name="Is it possible to do integer arithmetic in templates?">
-      <p>Yes. As of 2.0, FreeMarker supports numerics without casting in and
-      out of TemplateScalarModel. The new TemplateNumberModel intrace means
-      that numbers of any given precision are supported, not just integers.
-      </p>
-      <p>The basic arithmetic operators are supported,
-      and meaningful comparison can be made between numbers. Internally, 
-      FreeMarker uses BigDecimals to ensure that no precision is lost when 
-      performing arithmetic operations.  See the <a href="docs/manual/index.html" target="_top">manual</a>
for further details.</p>
-    </topic>
-    <topic id="editorMangle" name="I'm using a visual HTML editor that mangles template
tags. Will you change the template language syntax to accomodate my editor?">
-<p>I won't change the standard version, because a lot of templates depend on it. 
-However, FreeMarker is designed to make it easy for you to change the syntax to 
-suit your needs. Changing the tag delimiters, making tags case-insensitive, and 
-representing operators differently would be simple changes to make. Take a look 
-at <tt>freemarker.template.compiler.FMParser.jj</tt>, for more details.
-Let me know if you need further explanation of anything in the source code.</p>
-<p>My view is that the editors that break template code are themselves broken; 
-you'll probably have the same problem if you try to use them with other template 
-systems. A good editor should ignore, not mangle, what it doesn't understand. </p>
-     </topic>
-     <topic id="structureInfo" name="How can my Java classes ask a template for information
about its structure (e.g. a list of all the variables)?">
-<p>This isn't possible, because variable names can be dynamically generated from 
-data (see the <a 
-href="docs/manual/expressions.html">manual</a>). 
-However, there's a more important reason why FreeMarker doesn't support this. 
-The design of FreeMarker is based on the idea of a separation between business 
-objects and presentation objects. This separation takes two forms: </p>
-<ol>
-  <li>The templates know what data to expect, but they don't know how it's 
-  generated. </li>
-  <li>The business objects know what data to produce, but they don't know how 
-  it's going to be displayed. Therefore, they don't know anything about 
-  templates. </li>
-</ol>
-<p>Since the business objects don't rely on the templates, if you need to use 
-them with some other presentation system, you won't have to rewrite your 
-application. </p>
-     </topic>
-  </topicgroup>
-  <topicgroup name="Legal issues">
-    <topic id="license" name="If we distribute FreeMarker with our product, do we have
to release the source code for our product?">
-      <p>No. As of 2.0, FreeMarker is released under the BSD license. This 
-      means that source or binary distributions may be made freely, and
-      can be included in other products, whether commercial or open source.</p>
-      <p>The only restrictions apply to the copyright of FreeMarker itself,
-      and the use of FreeMarker or its contributors as endorsements of
-      your own product. See the <a href="LICENSE.txt">LICENSE</a> for
-      further details.</p>
-      <p>If you use FreeMarker, I hope you'll send me a link to some information about

-      your product, but that's optional as well.</p> 
-    </topic>
-  </topicgroup>
-</faq>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/19c2b987/src/examples/struts-webapp/WEB-INF/classes/example/AddAction.java
----------------------------------------------------------------------
diff --git a/src/examples/struts-webapp/WEB-INF/classes/example/AddAction.java b/src/examples/struts-webapp/WEB-INF/classes/example/AddAction.java
deleted file mode 100644
index f2df9a4..0000000
--- a/src/examples/struts-webapp/WEB-INF/classes/example/AddAction.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package example;
-
-import java.util.List;
-import javax.servlet.http.*;
-import org.apache.struts.action.*;
-
-
-public class AddAction extends GuestbookAction {
-
-    public ActionForward execute(
-            ActionMapping mapping,
-            ActionForm form,
-            HttpServletRequest req,
-            HttpServletResponse resp) throws Exception {
-
-        GuestbookEntryForm f = (GuestbookEntryForm) form;
-        List guestbook = getGuestbook();
-        synchronized (guestbook) {
-            guestbook.add(0, new GuestbookEntry(
-                    f.getName(), f.getEmail(), f.getMessage()));
-        }
-        
-        return mapping.findForward("success");
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/19c2b987/src/examples/struts-webapp/WEB-INF/classes/example/ApplicationResources.properties
----------------------------------------------------------------------
diff --git a/src/examples/struts-webapp/WEB-INF/classes/example/ApplicationResources.properties
b/src/examples/struts-webapp/WEB-INF/classes/example/ApplicationResources.properties
deleted file mode 100644
index 7d6f5c8..0000000
--- a/src/examples/struts-webapp/WEB-INF/classes/example/ApplicationResources.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-errors.header=<p><font color=red>Please correct the following problems:</font><ul>
-errors.prefix=<li><font color=red>
-errors.suffix=</font>
-errors.footer=</ul>
-errors.required={0} is required.

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/19c2b987/src/examples/struts-webapp/WEB-INF/classes/example/FormAction.java
----------------------------------------------------------------------
diff --git a/src/examples/struts-webapp/WEB-INF/classes/example/FormAction.java b/src/examples/struts-webapp/WEB-INF/classes/example/FormAction.java
deleted file mode 100644
index 183fde5..0000000
--- a/src/examples/struts-webapp/WEB-INF/classes/example/FormAction.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package example;
-
-import javax.servlet.http.*;
-import org.apache.struts.action.*;
-
-
-public class FormAction extends GuestbookAction {
-
-    public ActionForward execute(
-            ActionMapping mapping,
-            ActionForm form,
-            HttpServletRequest req,
-            HttpServletResponse resp) throws Exception {
-
-        return mapping.findForward("success");
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/19c2b987/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookAction.java
----------------------------------------------------------------------
diff --git a/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookAction.java b/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookAction.java
deleted file mode 100644
index 6d8a7d4..0000000
--- a/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookAction.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package example;
-
-import java.util.*;
-import org.apache.struts.action.*;
-
-/**
- * Defines utility methods for this application. 
- */
-public class GuestbookAction extends Action {
-    
-    ArrayList getGuestbook() {
-        return (ArrayList) servlet.getServletContext()
-                .getAttribute(GuestbookActionServlet.GUESTBOOK_KEY);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/19c2b987/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookActionServlet.java
----------------------------------------------------------------------
diff --git a/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookActionServlet.java
b/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookActionServlet.java
deleted file mode 100644
index b7e0496..0000000
--- a/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookActionServlet.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package example;
-
-import java.util.*;
-import javax.servlet.*;
-
-import org.apache.struts.action.ActionServlet;
-
-public class GuestbookActionServlet extends ActionServlet {
-    
-    static final String GUESTBOOK_KEY = "guestbook";
-    
-    public void init(ServletConfig scfg) throws ServletException {
-        super.init(scfg);
-        
-        ServletContext sctx = scfg.getServletContext();
-        
-        // Add application specific global objects
-        sctx.setAttribute(GUESTBOOK_KEY, new ArrayList()); 
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/19c2b987/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookEntry.java
----------------------------------------------------------------------
diff --git a/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookEntry.java b/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookEntry.java
deleted file mode 100644
index 76fa240..0000000
--- a/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookEntry.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package example;
-
-public class GuestbookEntry {
-    private String name;
-    private String email;
-    private String message;
-
-    public GuestbookEntry(String name, String email, String message) {
-        this.name = name;
-        this.email = email;
-        this.message = message;
-    }
-
-    public String getEmail() {
-        return email;
-    }
-
-    public String getMessage() {
-        return message;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/19c2b987/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookEntryForm.java
----------------------------------------------------------------------
diff --git a/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookEntryForm.java b/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookEntryForm.java
deleted file mode 100644
index 12b4dd6..0000000
--- a/src/examples/struts-webapp/WEB-INF/classes/example/GuestbookEntryForm.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package example;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.struts.action.*;
-
-public class GuestbookEntryForm extends ActionForm {
-    private String name;
-    private String email;
-    private String message;
-    
-    public GuestbookEntryForm() {
-    }
-
-    public String getEmail() {
-        return email;
-    }
-
-    public void setEmail(String email) {
-        this.email = normalizeString(email);
-    }
-
-    public String getMessage() {
-        return message;
-    }
-
-    public void setMessage(String message) {
-        this.message = normalizeString(message);
-    }
-
-    public void setName(String name) {
-        this.name = normalizeString(name);
-    }
-
-    public String getName() {
-        return name;
-    }
-    
-    public ActionErrors validate(ActionMapping arg0, HttpServletRequest arg1) {
-        ActionErrors errs = new ActionErrors();
-        if (name.length() == 0) {
-            errs.add("name", new ActionError("errors.required", "name"));
-        }
-        if (message.length() == 0) {
-            errs.add("message", new ActionError("errors.required", "message"));
-        }
-        return errs.size() == 0 ? null : errs;
-    }
-    
-    private static String normalizeString(String s) {
-        if (s == null) return "";
-        return s.trim();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/19c2b987/src/examples/struts-webapp/WEB-INF/classes/example/IndexAction.java
----------------------------------------------------------------------
diff --git a/src/examples/struts-webapp/WEB-INF/classes/example/IndexAction.java b/src/examples/struts-webapp/WEB-INF/classes/example/IndexAction.java
deleted file mode 100644
index 695c283..0000000
--- a/src/examples/struts-webapp/WEB-INF/classes/example/IndexAction.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package example;
-
-import java.util.*;
-import javax.servlet.http.*;
-import org.apache.struts.action.*;
-
-public class IndexAction extends GuestbookAction {
-    public ActionForward execute(
-            ActionMapping mapping,
-            ActionForm form,
-            HttpServletRequest req,
-            HttpServletResponse resp) throws Exception {
-
-        List snapShot;
-        
-        synchronized (getGuestbook()) {
-            snapShot = (List) getGuestbook().clone();
-        }
-        req.setAttribute("guestbook", snapShot);
-        
-        return mapping.findForward("success");
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/19c2b987/src/examples/struts-webapp/WEB-INF/struts-config.xml
----------------------------------------------------------------------
diff --git a/src/examples/struts-webapp/WEB-INF/struts-config.xml b/src/examples/struts-webapp/WEB-INF/struts-config.xml
deleted file mode 100644
index 2a50399..0000000
--- a/src/examples/struts-webapp/WEB-INF/struts-config.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-  
-    http://www.apache.org/licenses/LICENSE-2.0
-  
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-
-<!DOCTYPE struts-config PUBLIC
-          "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
-          "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
-
-<struts-config>
-  <form-beans>
-    <form-bean name="guestbookEntry" type="example.GuestbookEntryForm"/>
-  </form-beans>
-    
-  <action-mappings>
-    <action
-          path="/index"
-          type="example.IndexAction">
-      <forward name="success" path="/index.ftl"/>
-    </action>
-
-    <action
-          path="/form"
-          type="example.FormAction"
-          name="guestbookEntry"
-          scope="request"
-          validate="false">
-      <forward name="success" path="/form.ftl"/>
-    </action>
-    
-    <action
-          path="/add"
-          type="example.AddAction"
-          name="guestbookEntry"
-          validate="true"
-          scope="request"
-          input="/form.do">
-      <forward name="success" path="/add.ftl"/>
-    </action>
-    
-  </action-mappings>
-
-  <message-resources parameter="example.ApplicationResources"/>
-
-</struts-config>
\ No newline at end of file



Mime
View raw message