Skip to content
Browse files

Gradle-based version of "hello" sample

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

0 comments on commit 1a7fb29

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