Permalink
Browse files

Deleting example of almost-never-used and confusingly-named feature.

  • Loading branch information...
1 parent de34b5b commit 225cbd964395df23dea0e298d8b1d210212b5e1c @ddekany ddekany committed May 26, 2011
View
38 src/examples/README.txt
@@ -1,47 +1,25 @@
Examples
========
-Examples for FreeMarker (FM).
-
-
-Web application 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 with Struts 1.1 Web app. framework: Guest-book
+struts-webapp Using FM in a Model-2 framework (Struts 1.1) with JSP taglibs
jython-webapp Web app. that uses Jython instead of Java Language
-jsp-webapp Embedding FM templates into JSP pages
+ant The FreeMarker XML transform Ant-task
-In order not to duplicate too much JAR files around, we have not fully built
-the example webapps. To build the example webapps, you need Ant
-(http://ant.apache.org/) and run the following commands from the base
-FreeMarker directory:
+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.
-You must create and edit dependencies.properties of the base FreeMarker
-directory, or the above will fail. An example of dependencies.properties:
-
- lib.servlet=/home/java/servlet/servlet2_3_jsp1_2.jar
- lib.struts=/home/java/strtus1_1/lib/struts.jar
- jython.home=/home/java/jython
-
-You need the lib.struts line only if you need the struts-webapp, and you need
-the jython.home line only if you need the jython-webapp.
-
-For more information please read the help.html or README.txt in the directory
-of examples. Especially, please read these files if the Web application does
-not show up after deployment.
+For more information read the help.html or README.txt in the directory of
+examples.
Note that you can build all Web applications using the single command:
-ant examples
-
-
-Other examples
---------------
-ant The FreeMarker XML transform Ant-task
+ ant examples
View
75 src/examples/jsp-webapp/WEB-INF/classes/freemarker/examples/jsp/SimpleBean.java
@@ -1,75 +0,0 @@
-/*
- * Copyright (c) 2003 The Visigoth Software Society. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution, if
- * any, must include the following acknowledgement:
- * "This product includes software developed by the
- * Visigoth Software Society (http://www.visigoths.org/)."
- * Alternately, this acknowledgement may appear in the software itself,
- * if and wherever such third-party acknowledgements normally appear.
- *
- * 4. Neither the name "FreeMarker", "Visigoth", nor any of the names of the
- * project contributors may be used to endorse or promote products derived
- * from this software without prior written permission. For written
- * permission, please contact visigoths@visigoths.org.
- *
- * 5. Products derived from this software may not be called "FreeMarker" or "Visigoth"
- * nor may "FreeMarker" or "Visigoth" appear in their names
- * without prior written permission of the Visigoth Software Society.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE VISIGOTH SOFTWARE SOCIETY OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Visigoth Software Society. For more
- * information on the Visigoth Software Society, please see
- * http://www.visigoths.org/
- */
-
-package freemarker.examples.jsp;
-
-public class SimpleBean
-{
- private static String[] arr = { "a","b","c","d"};
-
- private String theString = "Hello from " + toString();
-
- public void setString( String foo )
- {
- theString = foo;
- }
-
- public String getString()
- {
- return theString;
- }
-
- public String[] getArray()
- {
- return arr;
- }
-}
View
22 src/examples/jsp-webapp/WEB-INF/fmtag.tld
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!DOCTYPE taglib
- PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
- "http://java.sun.com/j2ee/dtds/web-jsptaglib_1_1.dtd">
-
-<taglib>
-
- <tlibversion>2.0</tlibversion>
- <jspversion>1.1</jspversion>
- <shortname>FreeMarker JSP Support</shortname>
-
- <tag>
- <name>template</name>
- <tagclass>freemarker.ext.jsp.FreemarkerTag</tagclass>
- <bodycontent>tagdependent</bodycontent>
- <info>Allows evaluation of FreeMarker templates inside JSP</info>
- <attribute>
- <name>caching</name>
- <required>false</required>
- </attribute>
- </tag>
-</taglib>
View
11 src/examples/jsp-webapp/WEB-INF/web.xml
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<!DOCTYPE web-app
- PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
- "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd"
->
-
-
-<web-app>
- <display-name>FreeMarker Example: Embedding FTL into JSP</display-name>
-</web-app>
View
32 src/examples/jsp-webapp/index.jsp
@@ -1,32 +0,0 @@
-<%@ taglib uri="/WEB-INF/fmtag.tld" prefix="fm" %>
-<jsp:useBean id="mybean" class="freemarker.examples.jsp.SimpleBean"/>
-<jsp:useBean id="mybeanreq" class="freemarker.examples.jsp.SimpleBean" scope="request"/>
-<fm:template>
-<html>
- <head>
- <title>FreeMarker JSP Example</title>
- </head>
- <body>
- <h1>FreeMarker JSP example</h1>
- <hr>
- <p>
- This page is a JSP page, yet most of its contents is generated using
- a FreeMarker template. The below lines are the output of calling
- properties on a JSP-declared bean from the FreeMarker template:
- </p>
-
- <#assign mybean = page.mybean>
- <#assign mybeanreq = request.mybeanreq>
-
- <p>page: ${mybean.string}
- <#list mybean.array as item>
- <br>${item}
- </#list>
- <br>request : ${mybeanreq.string}
-
- <p><b>Note:</b> Starting from FreeMarker 2.2 you can use custom JSP tags in
- FreeMarker templates. If you want to migrate from JSP to FTL (i.e. FreeMarker templates),
- then that's probably a better option than embedding FTL into JSP pages.
-</body>
-</html>
-</fm:template>

0 comments on commit 225cbd9

Please sign in to comment.