Skip to content
This repository
Browse code

Gradle-based version of "hello" sample

  • Loading branch information...
commit 1a7fb2933ca036a60208d33dad1a9316cb23539c 1 parent 87105e6
Sean Gilligan authored July 02, 2012
3  sitemesh-examples-gradle-hello/WEB-INF/sitemesh3.xml
... ...
@@ -0,0 +1,3 @@
  1
+<sitemesh>
  2
+  <mapping path="/*" decorator="/decorator.html"/>
  3
+</sitemesh>
21  sitemesh-examples-gradle-hello/WEB-INF/web.xml
... ...
@@ -0,0 +1,21 @@
  1
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
  2
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3
+   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  4
+   version="2.5">
  5
+  
  6
+  <display-name>SiteMesh Gradle Test</display-name>
  7
+  <description>
  8
+     Small webapp for Sitemesh testing
  9
+  </description>
  10
+
  11
+  <filter>
  12
+    <filter-name>sitemesh</filter-name>
  13
+    <filter-class>org.sitemesh.config.ConfigurableSiteMeshFilter</filter-class>
  14
+  </filter>
  15
+
  16
+  <filter-mapping>
  17
+    <filter-name>sitemesh</filter-name>
  18
+    <url-pattern>/*</url-pattern>
  19
+  </filter-mapping>
  20
+
  21
+</web-app>
41  sitemesh-examples-gradle-hello/build.gradle
... ...
@@ -0,0 +1,41 @@
  1
+/*
  2
+ */
  3
+
  4
+import org.apache.ivy.plugins.resolver.URLResolver
  5
+
  6
+apply plugin: 'java'
  7
+apply plugin: 'groovy'
  8
+apply plugin: 'war'
  9
+apply plugin: 'jetty'
  10
+
  11
+
  12
+def compatibilityVersion = 1.5
  13
+sourceCompatibility = compatibilityVersion
  14
+targetCompatibility = compatibilityVersion
  15
+
  16
+jettyRun.contextPath = ''
  17
+jettyRun.webAppSourceDirectory = file("$rootDir")
  18
+
  19
+dependencies {
  20
+    runtime fileTree(dir: 'lib', include: '*.jar')
  21
+}
  22
+
  23
+repositories {
  24
+    mavenCentral()
  25
+}
  26
+
  27
+sourceSets {
  28
+    main {
  29
+        output.classesDir = file('web-app/WEB-INF/classes')
  30
+    }
  31
+}
  32
+
  33
+dependencies {
  34
+    groovy 'org.codehaus.groovy:groovy-all:1.8.4'
  35
+
  36
+    testCompile 'javax.servlet:servlet-api:2.5'
  37
+}
  38
+
  39
+clean.doLast {
  40
+     delete sourceSets*.output.classesDir
  41
+}
26  sitemesh-examples-gradle-hello/decorator.html
... ...
@@ -0,0 +1,26 @@
  1
+<html>
  2
+  <head>
  3
+    <title>SiteMesh example: <sitemesh:write property='title'/></title>
  4
+    <style type='text/css'>
  5
+      /* Some CSS */
  6
+     body { font-family: arial, sans-serif; background-color: #ffffcc; }
  7
+     h1, h2, h3, h4 { text-align: center; background-color: #ccffcc;
  8
+                      border-top: 1px solid #66ff66; }
  9
+     .mainBody { padding: 10px; border: 1px solid #555555; }
  10
+     .disclaimer { text-align: center; border-top: 1px solid #cccccc;
  11
+                   margin-top: 40px; color: #666666; font-size: smaller; }
  12
+    </style>
  13
+    <sitemesh:write property='head'/>
  14
+  </head>
  15
+  <body>
  16
+
  17
+    <h1 class='title'>SiteMesh example site: <sitemesh:write property='title'/></h1>
  18
+
  19
+    <div class='mainBody'>
  20
+      <sitemesh:write property='body'/>
  21
+    </div>
  22
+
  23
+    <div class='disclaimer'>Site disclaimer. This is an example.</div>
  24
+
  25
+  </body>
  26
+</html>
9  sitemesh-examples-gradle-hello/hello.html
... ...
@@ -0,0 +1,9 @@
  1
+<html>
  2
+  <head>
  3
+    <title>Hello World</title>
  4
+    <meta name='description' content='A simple page'>
  5
+  </head>
  6
+  <body>
  7
+    <p>Hello <strong>world</strong>!</p>
  8
+  </body>
  9
+</html>

0 notes on commit 1a7fb29

Please sign in to comment.
Something went wrong with that request. Please try again.