Commits

Anonymous committed 61e8711

Initial import

  • Participants

Comments (0)

Files changed (22)

+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
+::--------::
+|| README ||
+::--------::
+
+"Hello Dolly" is a tiny "Hello World" sort of application to demonstrate
+how JWebMVC can be integrated with different view technologies, viz
+- StringTemplate
+- Freemarker templates
+- Velocity templates
+- JSP (this technique also applies to JSF)
+
+JWebMVC is part of Bitumen Framework:
+http://code.google.com/p/bitumenframework/
+
+Hello Dolly is Open Source software (Apache 2.0 license). Read the file
+LICENSE.txt for licensing details.
+
+For discussions, consider joining the group:
+http://groups.google.com/group/bitumenframework
+
+You can also contact me directly by writing to kumar.shantanu@gmail.com
+
+
+::------------------::
+|| ADDITIONAL NOTES ||
+::------------------::
+
+This project uses the following Open Source libraries:
+
+- Embedded H2 database for development-mode
+- Embedded Jetty servlet container for development-mode
+- Bitumen Jettify as a helper to embed Jetty servlet container
+- Bitumen JWebMVC as the Servlet controller for MVC-2 stuff
+- Hibernate + Hibernate Annotations for Object-Relational Mapping
+- StringTemplate for view layer (HTML templating)
+
+You need Maven2 to build/run the code:
+
+$ mvn clean package jetty:run-war
+
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" 
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
+                             http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.bitumenframework.app.hellodolly</groupId>
+  <artifactId>hellodolly</artifactId>
+  <version>0.1-SNAPSHOT</version>
+  <packaging>war</packaging>
+  <name>HelloDolly - Taimen demo app for web template libraries</name>
+  
+  <repositories>
+	<repository>
+      <id>clojars.org</id>
+      <url>http://clojars.org/repo</url>
+    </repository>
+  </repositories>
+
+  <dependencies>
+	<dependency>
+      <groupId>org.antlr</groupId>
+      <artifactId>stringtemplate</artifactId>
+      <version>3.2.1</version>
+    </dependency>	
+	<dependency>
+      <groupId>org.apache.velocity</groupId>
+      <artifactId>velocity</artifactId>
+      <version>1.6.3</version>
+    </dependency>
+	<dependency>
+      <groupId>freemarker</groupId>
+      <artifactId>freemarker</artifactId>
+      <version>2.3.9</version>
+    </dependency>
+	
+	<dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.5</version>
+	  <scope>provided</scope>
+    </dependency>
+	<dependency>
+      <groupId>org.bitumenframework.taimen</groupId>
+      <artifactId>taimen-java</artifactId>
+      <version>0.1-BETA1</version>
+    </dependency>
+	<dependency>
+      <groupId>commons-fileupload</groupId>
+      <artifactId>commons-fileupload</artifactId>
+      <version>1.2.1</version>
+    </dependency>
+	<dependency>
+      <groupId>org.bitumenframework.jettify</groupId>
+      <artifactId>jettify-java</artifactId>
+      <version>0.2</version>
+	  <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>clojure-http-client</groupId>
+      <artifactId>clojure-http-client</artifactId>
+      <version>1.0.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.htmlparser</groupId>
+      <artifactId>htmlparser</artifactId>
+      <version>1.6</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+	  
+	  <plugin>
+        <groupId>org.mortbay.jetty</groupId>
+        <artifactId>maven-jetty-plugin</artifactId>
+        <configuration>
+		  <webApp>${basedir}/target/hellodolly-0.1-SNAPSHOT.war</webApp>
+		  <contextPath>hellodolly</contextPath>
+		  <!--
+          <webAppSourceDirectory>${basedir}/src/main/staticfiles</webAppSourceDirectory>
+          <webXml>${basedir}/src/main/webapp/WEB-INF/web.xml</webXml>
+		  -->
+		  <!--
+          <jettyEnvXml>${basedir}/src/over/here/jetty-env.xml</jettyEnvXml>
+		  -->
+		  <!--
+          <classesDirectory>${basedir}/somewhere/else</classesDirectory>
+		  -->
+		  <!--
+          <scanTargets>
+            <scanTarget>src/mydir</scanTarget>
+            <scanTarget>src/myfile.txt</scanTarget>
+          </scanTargets>
+          <scanTargetPatterns>
+            <scanTargetPattern>
+              <directory>src/other-resources</directory>
+              <includes>
+                <include>**/*.xml</include>
+                <include>**/*.properties</include>
+              </includes>
+              <excludes>
+                <exclude>**/myspecial.xml</exclude>
+                <exclude>**/myspecial.properties</exclude>
+              </excludes>
+            </scanTargetPattern>
+          </scanTargetPatterns>
+		  -->
+        </configuration>
+      </plugin>
+	  
+    </plugins>
+	
+	<resources>
+	  <resource>
+		<directory>src/main/resources</directory>
+	  </resource>
+	  <resource>
+		<directory>src/resources/dev</directory>
+		<includes>
+		  <include>hibernate.properties</include>
+		</includes>
+		<filtering>true</filtering>
+	  </resource>
+	  <resource>
+		<directory>src/resources/dev</directory>
+		<excludes>
+		  <exclude>hibernate.properties</exclude>
+		</excludes>
+		<filtering>false</filtering>
+	  </resource>
+	</resources>	
+	
+  </build>
+  
+  <profiles>
+	<profile>
+		<id>env-production</id>
+		<activation>
+			<property>
+				<name>env</name>
+				<value>production</value>
+			</property>
+		</activation>
+		<build>
+			<resources>
+				<resource>
+					<directory>src/resources/production</directory>
+					<includes>
+						<include>hibernate.properties</include>
+					</includes>
+					<filtering>true</filtering>
+				</resource>
+			</resources>
+		</build>
+		<!--
+		<dependencies>
+			<dependency>
+				<groupId>mysql</groupId>
+				<artifactId>mysql-connector-java</artifactId>
+				<version>5.0.5</version>
+				<scope>provided</scope>
+			</dependency>
+		</dependencies>
+		<properties>
+			<hibernate.datasource>java:comp/env/jdbc/live_datasource</hibernate.datasource>
+		</properties>
+		-->
+	</profile>
+    </profiles>
+  
+</project>

src/main/java/org/bitumenframework/app/hellodolly/DisplayHtmlFileFromClasspath.java

+package org.bitumenframework.app.hellodolly;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.bitumenframework.taimen.impl.ModelUtil;
+import org.bitumenframework.taimen.impl.action.PassthroughAction;
+import org.bitumenframework.taimen.util.ArgsUtil;
+
+public class DisplayHtmlFileFromClasspath extends PassthroughAction {
+    
+    private final String body;
+    
+    public DisplayHtmlFileFromClasspath(final String filename) throws IOException {
+		ClassLoader cl = Thread.currentThread().getContextClassLoader();
+		InputStream is = cl.getResourceAsStream(filename);
+		if (is == null ) {
+			cl = this.getClass().getClassLoader();
+			is = cl.getResourceAsStream(filename);
+		}
+		ArgsUtil.assertNotNull(is, "'inputStream (is)' is null");
+        final BufferedReader in = new BufferedReader(new InputStreamReader(is));
+        final StringBuilder sb = new StringBuilder();
+        for (String line = in.readLine(); line != null; line = in.readLine()) {
+            sb.append(line);
+            sb.append('\n');
+        }
+        in.close();
+        this.body = sb.toString();
+    }
+    
+    @Override
+    public Map<String, Object> execute(final HttpServletRequest request,
+            final Map<String, String> routeVariables, final Map<String, Object> model) {
+        return ModelUtil.createHtmlModel(body);
+    }
+    
+}

src/main/java/org/bitumenframework/app/hellodolly/HelloServlet.java

+package org.bitumenframework.app.hellodolly;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.velocity.app.VelocityEngine;
+import org.bitumenframework.taimen.IActionFactory;
+import org.bitumenframework.taimen.impl.UnmodifiableRouteMapBuilder;
+import org.bitumenframework.taimen.impl.action.ActionUtil;
+import org.bitumenframework.taimen.route.IRoute;
+import org.bitumenframework.taimen.servlet.DefaultFixedRouteServlet;
+
+public class HelloServlet extends DefaultFixedRouteServlet {
+    
+    /**
+     * Default serial version UID.
+     */
+    private static final long serialVersionUID = 1L;
+    
+    @Override
+    protected Map<? extends IRoute, ? extends Collection<? extends IActionFactory>> getRouteMap() {
+        final Properties velocityProps = new Properties();
+        velocityProps.setProperty("resource.loader", "class");
+        
+        velocityProps.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
+        velocityProps.setProperty("class.resource.loader.cache", "false");
+        velocityProps.setProperty("class.resource.loader.modificationCheckInterval", "2");
+        velocityProps.setProperty("class.resource.loader.path", "" /*"/WEB-INF/views"*/);
+        velocityProps.setProperty("runtime.log.logsystem.class", "org.apache.velocity.runtime.log.NullLogSystem");
+        VelocityEngine velocityEngine = null;
+        try {
+            velocityEngine = new VelocityEngine(velocityProps);
+            velocityEngine.init();
+        } catch (final Exception e) {
+            throw new RuntimeException(e);
+        }
+        
+        try {
+            return new UnmodifiableRouteMapBuilder()
+            .GET ("/hello",  ActionUtil.inContextRedirectAction("/hello/homepage"))
+            .GET ("/hello/", ActionUtil.inContextRedirectAction("/hello/homepage"))
+            .GET ("/hello/homepage", new DisplayHtmlFileFromClasspath("homepage.html"))
+            .POST("/hello/sayhello", new SayHelloFactory(velocityEngine))
+            .build();
+        } catch (final IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+    
+}

src/main/java/org/bitumenframework/app/hellodolly/SayHelloFactory.java

+package org.bitumenframework.app.hellodolly;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.velocity.app.VelocityEngine;
+import org.bitumenframework.taimen.IAction;
+import org.bitumenframework.taimen.IActionFactory;
+import org.bitumenframework.taimen.impl.ModelUtil;
+import org.bitumenframework.taimen.impl.action.PassthroughAction;
+import org.bitumenframework.taimen.util.ArgsUtil;
+import org.bitumenframework.taimen.util.RequestUtil;
+
+public class SayHelloFactory implements IActionFactory {
+    
+    private static final String STRINGTEMPLATE = "stringtemplate";
+    private static final String JSP            = "jsp";
+    private static final String FREEMARKER     = "freemarker";
+    private static final String VELOCITY       = "velocity";
+    
+    private static final List<String> viewNames = Arrays.asList(
+            STRINGTEMPLATE, JSP, FREEMARKER, VELOCITY);
+    
+    public class Form {
+        public String name;
+        public String view;
+        public boolean isValid() {
+            return !ArgsUtil.isNullOrEmpty(name) && viewNames.contains(view);
+        }
+    }
+    
+    private final VelocityEngine velocityEngine;
+    
+    public SayHelloFactory(final VelocityEngine velocityEngine) {
+        this.velocityEngine = velocityEngine;
+    }
+    
+    public IAction getAction(final HttpServletRequest request,
+            final Map<String, String> routeVariables, final Map<String, Object> model) {
+        final Form bean = RequestUtil.extractParamValuesAsBean(request, new Form());
+        if (bean.isValid()) {
+            if (STRINGTEMPLATE.equalsIgnoreCase(bean.view)) {
+                return new SayHelloStringtemplate(bean.name);
+            } else if (FREEMARKER.equalsIgnoreCase(bean.view)) {
+                return new SayHelloFreemarker(bean.name);
+            } else if (VELOCITY.equalsIgnoreCase(bean.view)) {
+                return new SayHelloVelocity(velocityEngine, bean.name);
+            } else {
+                return new SayHelloJsp(bean.name);
+            }
+        }
+        return new PassthroughAction() {
+            @Override
+            public Map<String, Object> execute(final HttpServletRequest request,
+                    final Map<String, String> routeVariables,
+                    final Map<String, Object> model) {
+                return ModelUtil.createHtmlModel(
+                        "<h2>Invalid input. Go back and try again.</h2>");
+            }
+        };
+    }
+    
+    public String getUniqueName() {
+        return getClass().toString();
+    }
+    
+}

src/main/java/org/bitumenframework/app/hellodolly/SayHelloFreemarker.java

+package org.bitumenframework.app.hellodolly;
+
+import java.io.IOException;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.bitumenframework.taimen.IResponseGenerator;
+import org.bitumenframework.taimen.impl.ModelUtil;
+import org.bitumenframework.taimen.impl.action.PassthroughAction;
+
+import freemarker.template.Template;
+
+public class SayHelloFreemarker extends PassthroughAction {
+    
+    private final String name;
+    
+    public SayHelloFreemarker(final String name) {
+        this.name = name;
+    }
+    
+    @Override
+    public Map<String, Object> execute(final HttpServletRequest request,
+            final Map<String, String> routeVariables, final Map<String, Object> model) {
+        final Map<String, String> data = new LinkedHashMap<String, String>();
+        data.put("context_path", request.getContextPath());
+        data.put("name", name);
+        
+        try {
+            final Template template = ViewUtil.getFreemarkerTemplate("sayhello.ftl");
+            return ModelUtil.createHtmlModel(new IResponseGenerator() {
+                public void respond(final HttpServletResponse response) {
+                    try {
+                        template.process(data, response.getWriter());
+                    } catch (final Exception e) {
+                        e.printStackTrace();
+                        throw new RuntimeException(e);
+                    }
+                }
+            });
+        } catch (final IOException e) {
+            e.printStackTrace();
+            return ModelUtil.createHtmlModel("Error occured: " + e.getMessage());
+        }
+    }
+    
+}

src/main/java/org/bitumenframework/app/hellodolly/SayHelloJsp.java

+package org.bitumenframework.app.hellodolly;
+
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.bitumenframework.taimen.impl.ModelUtil;
+import org.bitumenframework.taimen.impl.action.PassthroughAction;
+
+public class SayHelloJsp extends PassthroughAction {
+    
+    private final String username;
+    
+    public SayHelloJsp(final String username) {
+        this.username = username;
+    }
+    
+    @Override
+    public Map<String, Object> execute(final HttpServletRequest request,
+            final Map<String, String> routeVariables, final Map<String, Object> model) {
+        request.setAttribute("context_path", request.getContextPath());
+        request.setAttribute("name",         username);
+        return ModelUtil.createForwardModel("/WEB-INF/sayhello.jsp");
+    }
+    
+}

src/main/java/org/bitumenframework/app/hellodolly/SayHelloStringtemplate.java

+package org.bitumenframework.app.hellodolly;
+
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.antlr.stringtemplate.StringTemplate;
+import org.bitumenframework.taimen.impl.ModelUtil;
+import org.bitumenframework.taimen.impl.action.PassthroughAction;
+
+public class SayHelloStringtemplate extends PassthroughAction {
+    
+    private final String name;
+    
+    public SayHelloStringtemplate(final String name) {
+        this.name = name;
+    }
+    
+    @Override
+    public Map<String, Object> execute(final HttpServletRequest request,
+            final Map<String, String> routeVariables, final Map<String, Object> model) {
+        final StringTemplate template = ViewUtil.getStringTemplate("sayhello",
+                request.getContextPath(), name);
+        return ModelUtil.createHtmlModel(template.toString());
+    }
+    
+}

src/main/java/org/bitumenframework/app/hellodolly/SayHelloVelocity.java

+package org.bitumenframework.app.hellodolly;
+
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.bitumenframework.taimen.IResponseGenerator;
+import org.bitumenframework.taimen.impl.ModelUtil;
+import org.bitumenframework.taimen.impl.action.PassthroughAction;
+
+public class SayHelloVelocity extends PassthroughAction {
+    
+    private final VelocityEngine velocityEngine;
+    private final String username;
+    
+    public SayHelloVelocity(final VelocityEngine velocityEngine, final String username) {
+        this.velocityEngine = velocityEngine;
+        this.username = username;
+    }
+    
+    @Override
+    public Map<String, Object> execute(final HttpServletRequest request,
+            final Map<String, String> routeVariables, final Map<String, Object> model) {
+        final VelocityContext data = new VelocityContext();
+        data.put("context_path", request.getContextPath());
+        data.put("name", username);
+        
+        try {
+            final Template template = ViewUtil.getVelocityTemplate(
+                    velocityEngine, "sayhello.vm");
+            return ModelUtil.createHtmlModel(new IResponseGenerator() {
+                public void respond(final HttpServletResponse response) {
+                    try {
+                        template.merge(data, response.getWriter());
+                    } catch (final Exception e) {
+                        e.printStackTrace();
+                        throw new RuntimeException(e);
+                    }
+                }
+            });
+        } catch (final Exception e) {
+            e.printStackTrace();
+            return ModelUtil.createHtmlModel("Error occured: " + e.getMessage());
+        }
+    }
+    
+}

src/main/java/org/bitumenframework/app/hellodolly/ViewUtil.java

+package org.bitumenframework.app.hellodolly;
+
+import java.io.IOException;
+import org.antlr.stringtemplate.StringTemplate;
+import org.antlr.stringtemplate.StringTemplateGroup;
+import org.apache.velocity.app.VelocityEngine;
+
+import freemarker.template.Configuration;
+
+public class ViewUtil {
+    
+    public static StringTemplate getStringTemplate(final String viewName,
+            final String contextPath, final String username) {
+        final StringTemplate template =
+            new StringTemplateGroup("default").getInstanceOf(viewName);
+        template.setAttribute("context_path", contextPath);
+        template.setAttribute("name", username);
+        return template;
+    }
+    
+    public static freemarker.template.Template getFreemarkerTemplate(final String viewName)
+    throws IOException {
+        final Configuration config = new Configuration();
+        config.setClassForTemplateLoading(ViewUtil.class, "/");
+        return config.getTemplate(viewName);
+    }
+    
+    public static org.apache.velocity.Template getVelocityTemplate(
+            final VelocityEngine velocityEngine, final String viewName)
+    throws Exception {
+        return velocityEngine.getTemplate(viewName);
+    }
+    
+}

src/main/resources/homepage.html

+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+    <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+    <title>Enter your name</title>
+    </head>
+    <body>
+        <form action="sayhello" method="post">
+            Enter your name&nbsp;<input type="text" name="name" />
+            <br/><br/>
+            View type
+            <input type="radio" name="view" value="stringtemplate" />StringTemplate
+            <input type="radio" name="view" value="jsp"        />JSP
+            <input type="radio" name="view" value="freemarker" />Freemarker
+            <input type="radio" name="view" value="velocity"   />Velocity
+            <br/><br/>
+            <input type="submit" value="Say Hello" />
+        </form>
+    </body>
+</html>

src/main/resources/sayhello.ftl

+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+    <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+    <title>Hello, ${name}!</title>
+    </head>
+    <body>
+        Hello, ${name}!
+        <br/>
+        <br/>
+        <a href="${context_path}/hello/homepage">Go back</a>
+    </body>
+</html>

src/main/resources/sayhello.st

+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+    <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+    <title>Hello, $name$!</title>
+    </head>
+    <body>
+        Hello, $name$!
+        <br/>
+        <br/>
+        <a href="$context_path$/hello/homepage">Go back</a>
+    </body>
+</html>

src/main/resources/sayhello.vm

+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+    <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+    <title>Hello, $name!</title>
+    </head>
+    <body>
+        Hello, $name!
+        <br/>
+        <br/>
+        <a href="$context_path/hello/homepage">Go back</a>
+    </body>
+</html>

src/main/webapp/WEB-INF/sayhello.jsp

+<%@page contentType="text/html"%>
+<jsp:useBean id="name"         class="java.lang.String"  scope = "request"/>
+<jsp:useBean id="context_path" class="java.lang.String"  scope = "request"/>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+    <head>
+    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+    <title>Hello, <%=name%>!</title>
+    </head>
+    <body>
+        Hello, <%=name%>!
+        <br/>
+        <br/>
+        <a href="<%=context_path%>/hello/homepage">Go back</a>
+    </body>
+</html>

src/main/webapp/WEB-INF/web.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<web-app>
+ <servlet>
+   <servlet-name>helloservlet</servlet-name>
+   <servlet-class>org.bitumenframework.app.hellodolly.HelloServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+   <servlet-name>helloservlet</servlet-name>
+   <url-pattern>/hello/*</url-pattern>
+ </servlet-mapping>
+</web-app>

src/main/webapp/index.jsp

+<%
+// this is to redirect all traffic from / to /hello/
+response.sendRedirect(request.getContextPath() + "/hello/");
+%>

src/resources/dev/hibernate.properties

+######################
+### Query Language ###
+######################
+
+## define query language constants / function names
+
+hibernate.query.substitutions yes 'Y', no 'N'
+
+
+## Query translator factory class
+
+#hibernate.query.factory_class @QUERY_TRANSLATOR_FACTORY@
+
+#################
+### Platforms ###
+#################
+
+# The included Hibernate JAR (3.2.7) contains fix for the following H2 bug:
+# http://opensource.atlassian.com/projects/hibernate/browse/HHH-3401
+
+hibernate.dialect org.hibernate.dialect.H2Dialect
+hibernate.connection.driver_class org.h2.Driver
+hibernate.connection.url jdbc:h2:~/lilliput
+hibernate.connection.username sa
+hibernate.connection.password sa
+
+#hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
+#hibernate.connection.driver_class org.postgresql.Driver
+#hibernate.connection.url jdbc:postgresql://localhost/lilliput
+#hibernate.connection.username postgres
+#hibernate.connection.password S3cr3t
+
+
+#hibernate.dialect @HIBERNATE_DIALECT@
+#hibernate.connection.driver_class @DRIVER_CLASS@
+#hibernate.connection.username @DB_USERNAME@
+#hibernate.connection.password @DB_PASSWORD@
+#hibernate.connection.url @DB_URL@
+
+## JNDI Datasource
+
+#hibernate.connection.datasource jdbc/test
+#hibernate.connection.username db2
+#hibernate.connection.password db2
+
+
+## HypersonicSQL
+
+#hibernate.dialect org.hibernate.dialect.HSQLDialect
+#hibernate.connection.driver_class org.hsqldb.jdbcDriver
+#hibernate.connection.username sa
+#hibernate.connection.password
+#hibernate.connection.url jdbc:hsqldb:hsql://localhost
+#hibernate.connection.url jdbc:hsqldb:test
+#hibernate.connection.url jdbc:hsqldb:.
+
+
+## MySQL
+
+
+#hibernate.dialect org.hibernate.dialect.MySQLDialect
+#hibernate.dialect org.hibernate.dialect.MySQLInnoDBDialect
+#hibernate.dialect org.hibernate.dialect.MySQLMyISAMDialect
+#hibernate.connection.driver_class org.gjt.mm.mysql.Driver
+#hibernate.connection.driver_class com.mysql.jdbc.Driver
+#hibernate.connection.url jdbc:mysql:///test
+#hibernate.connection.username gavin
+#hibernate.connection.password
+
+
+## Oracle
+
+#hibernate.dialect org.hibernate.dialect.OracleDialect
+#hibernate.dialect org.hibernate.dialect.Oracle9Dialect
+#hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
+#hibernate.connection.username ora
+#hibernate.connection.password ora
+#hibernate.connection.url jdbc:oracle:thin:@localhost:1521:test
+
+
+## PostgreSQL
+
+#hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
+#hibernate.connection.driver_class org.postgresql.Driver
+#hibernate.connection.url jdbc:postgresql:template1
+#hibernate.connection.username pg
+#hibernate.connection.password
+#hibernate.query.substitutions yes 'Y', no 'N'
+
+
+## DB2
+
+#hibernate.dialect org.hibernate.dialect.DB2Dialect
+#hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver
+#hibernate.connection.url jdbc:db2:test
+#hibernate.connection.username db2
+#hibernate.connection.password db2
+
+## TimesTen (not supported yet)
+
+#hibernate.dialect org.hibernate.dialect.TimesTenDialect
+#hibernate.connection.driver_class com.timesten.jdbc.TimesTenDriver
+#hibernate.connection.url jdbc:timesten:direct:test
+#hibernate.connection.username
+#hibernate.connection.password 
+
+## DB2/400
+
+#hibernate.dialect org.hibernate.dialect.DB2400Dialect
+#hibernate.connection.username user
+#hibernate.connection.password password
+
+## Native driver
+#hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver
+#hibernate.connection.url jdbc:db2://systemname
+
+## Toolbox driver
+#hibernate.connection.driver_class com.ibm.as400.access.AS400JDBCDriver
+#hibernate.connection.url jdbc:as400://systemname
+
+
+## Derby (Not supported!)
+
+#hibernate.dialect org.hibernate.dialect.DerbyDialect
+#hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver
+#hibernate.connection.username
+#hibernate.connection.password
+#hibernate.connection.url jdbc:derby:/test;create=true
+
+
+## Sybase
+
+#hibernate.dialect org.hibernate.dialect.SybaseDialect
+#hibernate.connection.driver_class com.sybase.jdbc2.jdbc.SybDriver
+#hibernate.connection.username sa
+#hibernate.connection.password sasasa
+#hibernate.connection.url jdbc:sybase:Tds:co3061835-a:5000/tempdb
+
+
+## Mckoi SQL
+
+#hibernate.dialect org.hibernate.dialect.MckoiDialect
+#hibernate.connection.driver_class com.mckoi.JDBCDriver
+#hibernate.connection.url jdbc:mckoi:///
+#hibernate.connection.url jdbc:mckoi:local://C:/mckoi1.00/db.conf
+#hibernate.connection.username admin
+#hibernate.connection.password nimda
+
+
+## SAP DB
+
+#hibernate.dialect org.hibernate.dialect.SAPDBDialect
+#hibernate.connection.driver_class com.sap.dbtech.jdbc.DriverSapDB
+#hibernate.connection.url jdbc:sapdb://localhost/TST
+#hibernate.connection.username TEST
+#hibernate.connection.password TEST
+#hibernate.query.substitutions yes 'Y', no 'N'
+
+
+## MS SQL Server
+
+#hibernate.dialect org.hibernate.dialect.SQLServerDialect
+#hibernate.connection.username sa
+#hibernate.connection.password sa
+
+## JSQL Driver
+#hibernate.connection.driver_class com.jnetdirect.jsql.JSQLDriver
+#hibernate.connection.url jdbc:JSQLConnect://1E1/test
+
+## JTURBO Driver
+#hibernate.connection.driver_class com.newatlanta.jturbo.driver.Driver
+#hibernate.connection.url jdbc:JTurbo://1E1:1433/test
+
+## WebLogic Driver
+#hibernate.connection.driver_class weblogic.jdbc.mssqlserver4.Driver
+#hibernate.connection.url jdbc:weblogic:mssqlserver4:1E1:1433
+
+## Microsoft Driver (not recommended!)
+#hibernate.connection.driver_class com.microsoft.jdbc.sqlserver.SQLServerDriver
+#hibernate.connection.url jdbc:microsoft:sqlserver://1E1;DatabaseName=test;SelectMethod=cursor
+
+## jTDS (since version 0.9)
+#hibernate.connection.driver_class net.sourceforge.jtds.jdbc.Driver
+#hibernate.connection.url jdbc:jtds:sqlserver://1E1/test
+
+## Interbase
+
+#hibernate.dialect org.hibernate.dialect.InterbaseDialect
+#hibernate.connection.username sysdba
+#hibernate.connection.password masterkey
+
+## DO NOT specify hibernate.connection.sqlDialect
+
+## InterClient
+
+#hibernate.connection.driver_class interbase.interclient.Driver
+#hibernate.connection.url jdbc:interbase://localhost:3060/C:/firebird/test.gdb
+
+## Pure Java
+
+#hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver
+#hibernate.connection.url jdbc:firebirdsql:localhost/3050:/firebird/test.gdb
+
+
+## Pointbase
+
+#hibernate.dialect org.hibernate.dialect.PointbaseDialect
+#hibernate.connection.driver_class com.pointbase.jdbc.jdbcUniversalDriver
+#hibernate.connection.url jdbc:pointbase:embedded:sample
+#hibernate.connection.username PBPUBLIC
+#hibernate.connection.password PBPUBLIC
+
+
+## Ingres
+
+#hibernate.dialect org.hibernate.dialect.IngresDialect 
+#hibernate.connection.driver_class ca.edbc.jdbc.EdbcDriver 
+#hibernate.connection.url jdbc:edbc://localhost:II7/database 
+#hibernate.connection.username user 
+#hibernate.connection.password password
+
+
+## Mimer SQL
+
+#hibernate.dialect org.hibernate.dialect.MimerSQLDialect
+#hibernate.connection.driver_class com.mimer.jdbc.Driver
+#hibernate.connection.url jdbc:mimer:multi1
+#hibernate.connection.username hibernate
+#hibernate.connection.password hibernate
+
+
+
+#################################
+### Hibernate Connection Pool ###
+#################################
+
+hibernate.connection.pool_size 1
+
+
+
+###########################
+### C3P0 Connection Pool###
+###########################
+
+#hibernate.c3p0.max_size 2
+#hibernate.c3p0.min_size 2
+#hibernate.c3p0.timeout 5000
+#hibernate.c3p0.max_statements 100
+#hibernate.c3p0.idle_test_period 3000
+#hibernate.c3p0.acquire_increment 2
+#hibernate.c3p0.validate false
+
+
+
+##############################
+### Proxool Connection Pool###
+##############################
+
+## Properties for external configuration of Proxool
+
+hibernate.proxool.pool_alias pool1
+
+## Only need one of the following
+
+#hibernate.proxool.existing_pool true
+#hibernate.proxool.xml proxool.xml
+#hibernate.proxool.properties proxool.properties
+
+
+
+#################################
+### Plugin ConnectionProvider ###
+#################################
+
+## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in ConnectionProvider using hueristics)
+
+#hibernate.connection.provider_class org.hibernate.connection.DriverManagerConnectionProvider
+#hibernate.connection.provider_class org.hibernate.connection.DatasourceConnectionProvider
+#hibernate.connection.provider_class org.hibernate.connection.C3P0ConnectionProvider
+#hibernate.connection.provider_class org.hibernate.connection.DBCPConnectionProvider
+#hibernate.connection.provider_class org.hibernate.connection.ProxoolConnectionProvider
+
+
+
+#######################
+### Transaction API ###
+#######################
+
+## Enable automatic flush during the JTA beforeCompletion() callback
+## (This setting is relevant with or without the Transaction API)
+
+#hibernate.transaction.flush_before_completion
+
+
+## Enable automatic session close at the end of transaction
+## (This setting is relevant with or without the Transaction API)
+
+#hibernate.transaction.auto_close_session
+
+
+## the Transaction API abstracts application code from the underlying JTA or JDBC transactions
+
+#hibernate.transaction.factory_class org.hibernate.transaction.JTATransactionFactory
+#hibernate.transaction.factory_class org.hibernate.transaction.JDBCTransactionFactory
+
+
+## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in JNDI
+## default is java:comp/UserTransaction
+## you do NOT need this setting if you specify hibernate.transaction.manager_lookup_class
+
+#jta.UserTransaction jta/usertransaction
+#jta.UserTransaction javax.transaction.UserTransaction
+#jta.UserTransaction UserTransaction
+
+
+## to use the second-level cache with JTA, Hibernate must be able to obtain the JTA TransactionManager
+
+#hibernate.transaction.manager_lookup_class org.hibernate.transaction.JBossTransactionManagerLookup
+#hibernate.transaction.manager_lookup_class org.hibernate.transaction.WeblogicTransactionManagerLookup
+#hibernate.transaction.manager_lookup_class org.hibernate.transaction.WebSphereTransactionManagerLookup
+#hibernate.transaction.manager_lookup_class org.hibernate.transaction.OrionTransactionManagerLookup
+#hibernate.transaction.manager_lookup_class org.hibernate.transaction.ResinTransactionManagerLookup
+
+
+
+##############################
+### Miscellaneous Settings ###
+##############################
+
+## print all generated SQL to the console
+
+hibernate.show_sql true
+
+
+## add comments to the generated SQL
+
+hibernate.use_sql_comments true
+
+
+## generate statistics
+
+#hibernate.generate_statistics true
+
+
+## auto schema export
+
+hibernate.hbm2ddl.auto create-drop
+#hibernate.hbm2ddl.auto create
+#hibernate.hbm2ddl.auto update
+
+
+## specify a default schema and catalog for unqualified tablenames
+
+#hibernate.default_schema test
+#hibernate.default_catalog test
+
+
+## enable ordering of SQL UPDATEs by primary key
+
+hibernate.order_updates true
+
+
+## set the maximum depth of the outer join fetch tree
+
+hibernate.max_fetch_depth 1
+
+
+## set the default batch size for batch fetching
+
+hibernate.default_batch_fetch_size 8
+
+
+## rollback generated identifier values of deleted entities to default values
+
+#hibernate.use_identifer_rollback true
+
+
+## enable bytecode reflection optimizer (disabled by default)
+
+#hibernate.bytecode.use_reflection_optimizer true
+
+
+
+#####################
+### JDBC Settings ###
+#####################
+
+## specify a JDBC isolation level
+
+#hibernate.connection.isolation 4
+
+
+## enable JDBC autocommit (not recommended!)
+
+#hibernate.connection.autocommit true
+
+
+## set the JDBC fetch size
+
+#hibernate.jdbc.fetch_size 25
+
+
+## set the maximum JDBC 2 batch size (a nonzero value enables batching)
+
+#hibernate.jdbc.batch_size 5
+
+
+## enable batch updates even for versioned data
+
+hibernate.jdbc.batch_versioned_data true
+
+
+## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate to use a sensible default)
+
+#hibernate.jdbc.use_scrollable_resultset true
+
+
+## use streams when writing binary types to / from JDBC
+
+hibernate.jdbc.use_streams_for_binary true
+
+
+## use JDBC 3 PreparedStatement.getGeneratedKeys() to get the identifier of an inserted row
+
+#hibernate.jdbc.use_get_generated_keys false
+
+
+## choose a custom JDBC batcher
+
+# hibernate.jdbc.factory_class
+
+
+## choose a custom SQL exception converter
+
+#hibernate.jdbc.sql_exception_converter
+
+
+
+##########################
+### Second-level Cache ###
+##########################
+
+## optimize chache for minimal "puts" instead of minimal "gets" (good for clustered cache)
+
+#hibernate.cache.use_minimal_puts true
+
+
+## set a prefix for cache region names
+
+hibernate.cache.region_prefix hibernate.test
+
+
+## disable the second-level cache
+
+#hibernate.cache.use_second_level_cache false
+
+
+## enable the query cache
+
+#hibernate.cache.use_query_cache true
+
+
+## store the second-level cache entries in a more human-friendly format
+
+#hibernate.cache.use_structured_entries true
+
+
+## choose a cache implementation
+
+#hibernate.cache.provider_class org.hibernate.cache.EhCacheProvider
+#hibernate.cache.provider_class org.hibernate.cache.EmptyCacheProvider
+hibernate.cache.provider_class org.hibernate.cache.HashtableCacheProvider
+#hibernate.cache.provider_class org.hibernate.cache.TreeCacheProvider
+#hibernate.cache.provider_class org.hibernate.cache.OSCacheProvider
+#hibernate.cache.provider_class org.hibernate.cache.SwarmCacheProvider
+
+
+## choose a custom query cache implementation
+
+#hibernate.cache.query_cache_factory
+
+
+
+############
+### JNDI ###
+############
+
+## specify a JNDI name for the SessionFactory
+
+#hibernate.session_factory_name hibernate/session_factory
+
+
+## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA UserTransaction;
+## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext() which
+## is the best approach in an application server
+
+#file system
+#hibernate.jndi.class com.sun.jndi.fscontext.RefFSContextFactory
+#hibernate.jndi.url file:/
+
+#WebSphere
+#hibernate.jndi.class com.ibm.websphere.naming.WsnInitialContextFactory
+#hibernate.jndi.url iiop://localhost:900/
+

src/resources/production/hibernate.properties

+######################
+### Query Language ###
+######################
+
+## define query language constants / function names
+
+hibernate.query.substitutions yes 'Y', no 'N'
+
+
+## Query translator factory class
+
+#hibernate.query.factory_class @QUERY_TRANSLATOR_FACTORY@
+
+#################
+### Platforms ###
+#################
+
+# The included Hibernate JAR (3.2.7) contains fix for the following H2 bug:
+# http://opensource.atlassian.com/projects/hibernate/browse/HHH-3401
+
+hibernate.dialect org.hibernate.dialect.H2Dialect
+hibernate.connection.driver_class org.h2.Driver
+hibernate.connection.url jdbc:h2:~/lilliput
+hibernate.connection.username sa
+hibernate.connection.password sa
+
+#hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
+#hibernate.connection.driver_class org.postgresql.Driver
+#hibernate.connection.url jdbc:postgresql://localhost/lilliput
+#hibernate.connection.username postgres
+#hibernate.connection.password S3cr3t
+
+
+#hibernate.dialect @HIBERNATE_DIALECT@
+#hibernate.connection.driver_class @DRIVER_CLASS@
+#hibernate.connection.username @DB_USERNAME@
+#hibernate.connection.password @DB_PASSWORD@
+#hibernate.connection.url @DB_URL@
+
+## JNDI Datasource
+
+#hibernate.connection.datasource jdbc/test
+#hibernate.connection.username db2
+#hibernate.connection.password db2
+
+
+## HypersonicSQL
+
+#hibernate.dialect org.hibernate.dialect.HSQLDialect
+#hibernate.connection.driver_class org.hsqldb.jdbcDriver
+#hibernate.connection.username sa
+#hibernate.connection.password
+#hibernate.connection.url jdbc:hsqldb:hsql://localhost
+#hibernate.connection.url jdbc:hsqldb:test
+#hibernate.connection.url jdbc:hsqldb:.
+
+
+## MySQL
+
+
+#hibernate.dialect org.hibernate.dialect.MySQLDialect
+#hibernate.dialect org.hibernate.dialect.MySQLInnoDBDialect
+#hibernate.dialect org.hibernate.dialect.MySQLMyISAMDialect
+#hibernate.connection.driver_class org.gjt.mm.mysql.Driver
+#hibernate.connection.driver_class com.mysql.jdbc.Driver
+#hibernate.connection.url jdbc:mysql:///test
+#hibernate.connection.username gavin
+#hibernate.connection.password
+
+
+## Oracle
+
+#hibernate.dialect org.hibernate.dialect.OracleDialect
+#hibernate.dialect org.hibernate.dialect.Oracle9Dialect
+#hibernate.connection.driver_class oracle.jdbc.driver.OracleDriver
+#hibernate.connection.username ora
+#hibernate.connection.password ora
+#hibernate.connection.url jdbc:oracle:thin:@localhost:1521:test
+
+
+## PostgreSQL
+
+#hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
+#hibernate.connection.driver_class org.postgresql.Driver
+#hibernate.connection.url jdbc:postgresql:template1
+#hibernate.connection.username pg
+#hibernate.connection.password
+#hibernate.query.substitutions yes 'Y', no 'N'
+
+
+## DB2
+
+#hibernate.dialect org.hibernate.dialect.DB2Dialect
+#hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver
+#hibernate.connection.url jdbc:db2:test
+#hibernate.connection.username db2
+#hibernate.connection.password db2
+
+## TimesTen (not supported yet)
+
+#hibernate.dialect org.hibernate.dialect.TimesTenDialect
+#hibernate.connection.driver_class com.timesten.jdbc.TimesTenDriver
+#hibernate.connection.url jdbc:timesten:direct:test
+#hibernate.connection.username
+#hibernate.connection.password 
+
+## DB2/400
+
+#hibernate.dialect org.hibernate.dialect.DB2400Dialect
+#hibernate.connection.username user
+#hibernate.connection.password password
+
+## Native driver
+#hibernate.connection.driver_class COM.ibm.db2.jdbc.app.DB2Driver
+#hibernate.connection.url jdbc:db2://systemname
+
+## Toolbox driver
+#hibernate.connection.driver_class com.ibm.as400.access.AS400JDBCDriver
+#hibernate.connection.url jdbc:as400://systemname
+
+
+## Derby (Not supported!)
+
+#hibernate.dialect org.hibernate.dialect.DerbyDialect
+#hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver
+#hibernate.connection.username
+#hibernate.connection.password
+#hibernate.connection.url jdbc:derby:/test;create=true
+
+
+## Sybase
+
+#hibernate.dialect org.hibernate.dialect.SybaseDialect
+#hibernate.connection.driver_class com.sybase.jdbc2.jdbc.SybDriver
+#hibernate.connection.username sa
+#hibernate.connection.password sasasa
+#hibernate.connection.url jdbc:sybase:Tds:co3061835-a:5000/tempdb
+
+
+## Mckoi SQL
+
+#hibernate.dialect org.hibernate.dialect.MckoiDialect
+#hibernate.connection.driver_class com.mckoi.JDBCDriver
+#hibernate.connection.url jdbc:mckoi:///
+#hibernate.connection.url jdbc:mckoi:local://C:/mckoi1.00/db.conf
+#hibernate.connection.username admin
+#hibernate.connection.password nimda
+
+
+## SAP DB
+
+#hibernate.dialect org.hibernate.dialect.SAPDBDialect
+#hibernate.connection.driver_class com.sap.dbtech.jdbc.DriverSapDB
+#hibernate.connection.url jdbc:sapdb://localhost/TST
+#hibernate.connection.username TEST
+#hibernate.connection.password TEST
+#hibernate.query.substitutions yes 'Y', no 'N'
+
+
+## MS SQL Server
+
+#hibernate.dialect org.hibernate.dialect.SQLServerDialect
+#hibernate.connection.username sa
+#hibernate.connection.password sa
+
+## JSQL Driver
+#hibernate.connection.driver_class com.jnetdirect.jsql.JSQLDriver
+#hibernate.connection.url jdbc:JSQLConnect://1E1/test
+
+## JTURBO Driver
+#hibernate.connection.driver_class com.newatlanta.jturbo.driver.Driver
+#hibernate.connection.url jdbc:JTurbo://1E1:1433/test
+
+## WebLogic Driver
+#hibernate.connection.driver_class weblogic.jdbc.mssqlserver4.Driver
+#hibernate.connection.url jdbc:weblogic:mssqlserver4:1E1:1433
+
+## Microsoft Driver (not recommended!)
+#hibernate.connection.driver_class com.microsoft.jdbc.sqlserver.SQLServerDriver
+#hibernate.connection.url jdbc:microsoft:sqlserver://1E1;DatabaseName=test;SelectMethod=cursor
+
+## jTDS (since version 0.9)
+#hibernate.connection.driver_class net.sourceforge.jtds.jdbc.Driver
+#hibernate.connection.url jdbc:jtds:sqlserver://1E1/test
+
+## Interbase
+
+#hibernate.dialect org.hibernate.dialect.InterbaseDialect
+#hibernate.connection.username sysdba
+#hibernate.connection.password masterkey
+
+## DO NOT specify hibernate.connection.sqlDialect
+
+## InterClient
+
+#hibernate.connection.driver_class interbase.interclient.Driver
+#hibernate.connection.url jdbc:interbase://localhost:3060/C:/firebird/test.gdb
+
+## Pure Java
+
+#hibernate.connection.driver_class org.firebirdsql.jdbc.FBDriver
+#hibernate.connection.url jdbc:firebirdsql:localhost/3050:/firebird/test.gdb
+
+
+## Pointbase
+
+#hibernate.dialect org.hibernate.dialect.PointbaseDialect
+#hibernate.connection.driver_class com.pointbase.jdbc.jdbcUniversalDriver
+#hibernate.connection.url jdbc:pointbase:embedded:sample
+#hibernate.connection.username PBPUBLIC
+#hibernate.connection.password PBPUBLIC
+
+
+## Ingres
+
+#hibernate.dialect org.hibernate.dialect.IngresDialect 
+#hibernate.connection.driver_class ca.edbc.jdbc.EdbcDriver 
+#hibernate.connection.url jdbc:edbc://localhost:II7/database 
+#hibernate.connection.username user 
+#hibernate.connection.password password
+
+
+## Mimer SQL
+
+#hibernate.dialect org.hibernate.dialect.MimerSQLDialect
+#hibernate.connection.driver_class com.mimer.jdbc.Driver
+#hibernate.connection.url jdbc:mimer:multi1
+#hibernate.connection.username hibernate
+#hibernate.connection.password hibernate
+
+
+
+#################################
+### Hibernate Connection Pool ###
+#################################
+
+hibernate.connection.pool_size 1
+
+
+
+###########################
+### C3P0 Connection Pool###
+###########################
+
+#hibernate.c3p0.max_size 2
+#hibernate.c3p0.min_size 2
+#hibernate.c3p0.timeout 5000
+#hibernate.c3p0.max_statements 100
+#hibernate.c3p0.idle_test_period 3000
+#hibernate.c3p0.acquire_increment 2
+#hibernate.c3p0.validate false
+
+
+
+##############################
+### Proxool Connection Pool###
+##############################
+
+## Properties for external configuration of Proxool
+
+hibernate.proxool.pool_alias pool1
+
+## Only need one of the following
+
+#hibernate.proxool.existing_pool true
+#hibernate.proxool.xml proxool.xml
+#hibernate.proxool.properties proxool.properties
+
+
+
+#################################
+### Plugin ConnectionProvider ###
+#################################
+
+## use a custom ConnectionProvider (if not set, Hibernate will choose a built-in ConnectionProvider using hueristics)
+
+#hibernate.connection.provider_class org.hibernate.connection.DriverManagerConnectionProvider
+#hibernate.connection.provider_class org.hibernate.connection.DatasourceConnectionProvider
+#hibernate.connection.provider_class org.hibernate.connection.C3P0ConnectionProvider
+#hibernate.connection.provider_class org.hibernate.connection.DBCPConnectionProvider
+#hibernate.connection.provider_class org.hibernate.connection.ProxoolConnectionProvider
+
+
+
+#######################
+### Transaction API ###
+#######################
+
+## Enable automatic flush during the JTA beforeCompletion() callback
+## (This setting is relevant with or without the Transaction API)
+
+#hibernate.transaction.flush_before_completion
+
+
+## Enable automatic session close at the end of transaction
+## (This setting is relevant with or without the Transaction API)
+
+#hibernate.transaction.auto_close_session
+
+
+## the Transaction API abstracts application code from the underlying JTA or JDBC transactions
+
+#hibernate.transaction.factory_class org.hibernate.transaction.JTATransactionFactory
+#hibernate.transaction.factory_class org.hibernate.transaction.JDBCTransactionFactory
+
+
+## to use JTATransactionFactory, Hibernate must be able to locate the UserTransaction in JNDI
+## default is java:comp/UserTransaction
+## you do NOT need this setting if you specify hibernate.transaction.manager_lookup_class
+
+#jta.UserTransaction jta/usertransaction
+#jta.UserTransaction javax.transaction.UserTransaction
+#jta.UserTransaction UserTransaction
+
+
+## to use the second-level cache with JTA, Hibernate must be able to obtain the JTA TransactionManager
+
+#hibernate.transaction.manager_lookup_class org.hibernate.transaction.JBossTransactionManagerLookup
+#hibernate.transaction.manager_lookup_class org.hibernate.transaction.WeblogicTransactionManagerLookup
+#hibernate.transaction.manager_lookup_class org.hibernate.transaction.WebSphereTransactionManagerLookup
+#hibernate.transaction.manager_lookup_class org.hibernate.transaction.OrionTransactionManagerLookup
+#hibernate.transaction.manager_lookup_class org.hibernate.transaction.ResinTransactionManagerLookup
+
+
+
+##############################
+### Miscellaneous Settings ###
+##############################
+
+## print all generated SQL to the console
+
+#hibernate.show_sql true
+
+
+## add comments to the generated SQL
+
+#hibernate.use_sql_comments true
+
+
+## generate statistics
+
+#hibernate.generate_statistics true
+
+
+## auto schema export
+
+hibernate.hbm2ddl.auto create-drop
+#hibernate.hbm2ddl.auto create
+#hibernate.hbm2ddl.auto update
+
+
+## specify a default schema and catalog for unqualified tablenames
+
+#hibernate.default_schema test
+#hibernate.default_catalog test
+
+
+## enable ordering of SQL UPDATEs by primary key
+
+hibernate.order_updates true
+
+
+## set the maximum depth of the outer join fetch tree
+
+hibernate.max_fetch_depth 1
+
+
+## set the default batch size for batch fetching
+
+hibernate.default_batch_fetch_size 8
+
+
+## rollback generated identifier values of deleted entities to default values
+
+#hibernate.use_identifer_rollback true
+
+
+## enable bytecode reflection optimizer (disabled by default)
+
+#hibernate.bytecode.use_reflection_optimizer true
+
+
+
+#####################
+### JDBC Settings ###
+#####################
+
+## specify a JDBC isolation level
+
+#hibernate.connection.isolation 4
+
+
+## enable JDBC autocommit (not recommended!)
+
+#hibernate.connection.autocommit true
+
+
+## set the JDBC fetch size
+
+#hibernate.jdbc.fetch_size 25
+
+
+## set the maximum JDBC 2 batch size (a nonzero value enables batching)
+
+#hibernate.jdbc.batch_size 5
+
+
+## enable batch updates even for versioned data
+
+hibernate.jdbc.batch_versioned_data true
+
+
+## enable use of JDBC 2 scrollable ResultSets (specifying a Dialect will cause Hibernate to use a sensible default)
+
+#hibernate.jdbc.use_scrollable_resultset true
+
+
+## use streams when writing binary types to / from JDBC
+
+hibernate.jdbc.use_streams_for_binary true
+
+
+## use JDBC 3 PreparedStatement.getGeneratedKeys() to get the identifier of an inserted row
+
+#hibernate.jdbc.use_get_generated_keys false
+
+
+## choose a custom JDBC batcher
+
+# hibernate.jdbc.factory_class
+
+
+## choose a custom SQL exception converter
+
+#hibernate.jdbc.sql_exception_converter
+
+
+
+##########################
+### Second-level Cache ###
+##########################
+
+## optimize chache for minimal "puts" instead of minimal "gets" (good for clustered cache)
+
+#hibernate.cache.use_minimal_puts true
+
+
+## set a prefix for cache region names
+
+hibernate.cache.region_prefix hibernate.test
+
+
+## disable the second-level cache
+
+#hibernate.cache.use_second_level_cache false
+
+
+## enable the query cache
+
+#hibernate.cache.use_query_cache true
+
+
+## store the second-level cache entries in a more human-friendly format
+
+#hibernate.cache.use_structured_entries true
+
+
+## choose a cache implementation
+
+#hibernate.cache.provider_class org.hibernate.cache.EhCacheProvider
+#hibernate.cache.provider_class org.hibernate.cache.EmptyCacheProvider
+hibernate.cache.provider_class org.hibernate.cache.HashtableCacheProvider
+#hibernate.cache.provider_class org.hibernate.cache.TreeCacheProvider
+#hibernate.cache.provider_class org.hibernate.cache.OSCacheProvider
+#hibernate.cache.provider_class org.hibernate.cache.SwarmCacheProvider
+
+
+## choose a custom query cache implementation
+
+#hibernate.cache.query_cache_factory
+
+
+
+############
+### JNDI ###
+############
+
+## specify a JNDI name for the SessionFactory
+
+#hibernate.session_factory_name hibernate/session_factory
+
+
+## Hibernate uses JNDI to bind a name to a SessionFactory and to look up the JTA UserTransaction;
+## if hibernate.jndi.* are not specified, Hibernate will use the default InitialContext() which
+## is the best approach in an application server
+
+#file system
+#hibernate.jndi.class com.sun.jndi.fscontext.RefFSContextFactory
+#hibernate.jndi.url file:/
+
+#WebSphere
+#hibernate.jndi.class com.ibm.websphere.naming.WsnInitialContextFactory
+#hibernate.jndi.url iiop://localhost:900/
+

src/test/java/org/bitumenframework/app/hellodolly/test/environment/InProcessTestEnvironment.java

+package org.bitumenframework.app.hellodolly.test.environment;
+
+import org.bitumenframework.jettify.JettyServer;
+
+public class InProcessTestEnvironment {
+    
+    private static final String publicDir = "public";
+    
+    // IDE users: You may need to point to absolute path
+    //private static final String publicDir = "C:/projects/hgrepos-local-bitumenframework/hellodolly/public";
+    
+    /**
+     * @param args
+     */
+    public static void main(String[] args) throws Exception {
+        final JettyServer server = new JettyServer();
+        server.setWebAppDir(publicDir);
+        server.start();
+    }