Skip to content
This repository was archived by the owner on Dec 15, 2018. It is now read-only.

Commit 17bc30a

Browse files
Daniel-Doschkal
authored andcommitted
update velocity-tool3 and update some templates engines
1 parent df99094 commit 17bc30a

File tree

18 files changed

+51
-330
lines changed

18 files changed

+51
-330
lines changed

examples/velocity/src/main/java/org/mvcspec/ozark/test/velocity/HelloController.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,17 @@ public class HelloController {
3939
@Controller
4040
@Produces("text/html")
4141
@View("hello.vm")
42+
@Path("v1")
4243
public void hello(@QueryParam("user") String user) {
4344
models.put("user", user);
4445
}
46+
47+
@GET
48+
@Controller
49+
@Produces("text/html")
50+
@View("hello2.vhtml")
51+
@Path("v2")
52+
public void hello2(@QueryParam("user2") String user2) {
53+
models.put("user2", user2);
54+
}
4555
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<html>
2+
<head>
3+
<title>Hello</title>
4+
<link rel="stylesheet" type="text/css" href="${request.contextPath}/ozark.css"/>
5+
</head>
6+
<body>
7+
<h1>Hello $mvc.encoders.html($user2)!</h1>
8+
</body>
9+
</html>

examples/velocity/src/main/webapp/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
<body>
99
<h1>Hello Controller using Velocity</h1>
1010
<ul>
11-
<li><a href="resources/hello?user=mvc">resources/hello?user=mvc</a>
11+
<li><a href="resources/hello/v1?user=mvc">resources/hello/v1?user=mvc</a>
12+
<li><a href="resources/hello/v2?user2=mvc">resources/hello/v2?user2=mvc</a>
1213
</ul>
1314
<br/>
1415
<a class="source" href="https://github.com/mvc-spec/ozark/blob/master/test/velocity/src/main/java/org/mvcspec/ozark/test/velocity/HelloController.java">Source Code</a>

examples/velocity/src/test/java/org/mvcspec/ozark/test/velocity/VelocityIT.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,14 @@ public void tearDown() {
4444

4545
@Test
4646
public void testView1() throws Exception {
47-
final HtmlPage page = webClient.getPage(webUrl + "resources/hello?user=mvc");
47+
final HtmlPage page = webClient.getPage(webUrl + "resources/hello/v1?user=mvc");
48+
final Iterator<HtmlElement> it = page.getDocumentElement().getHtmlElementsByTagName("h1").iterator();
49+
assertTrue(it.next().asText().contains("mvc"));
50+
}
51+
52+
@Test
53+
public void testView2() throws Exception {
54+
final HtmlPage page = webClient.getPage(webUrl + "resources/hello/v2?user2=mvc");
4855
final Iterator<HtmlElement> it = page.getDocumentElement().getHtmlElementsByTagName("h1").iterator();
4956
assertTrue(it.next().asText().contains("mvc"));
5057
}

ext/asciidoc/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<dependency>
3232
<groupId>org.asciidoctor</groupId>
3333
<artifactId>asciidoctorj</artifactId>
34-
<version>1.5.4</version>
34+
<version>1.5.7</version>
3535
<scope>compile</scope>
3636
</dependency>
3737
</dependencies>

ext/freemarker/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<dependency>
3131
<groupId>org.freemarker</groupId>
3232
<artifactId>freemarker</artifactId>
33-
<version>2.3.26-incubating</version>
33+
<version>2.3.28</version>
3434
<scope>compile</scope>
3535
</dependency>
3636
</dependencies>

ext/groovy/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<dependency>
3535
<groupId>org.codehaus.groovy</groupId>
3636
<artifactId>groovy-templates</artifactId>
37-
<version>2.5.0</version>
37+
<version>2.5.3</version>
3838
</dependency>
3939
</dependencies>
4040
</project>

ext/handlebars/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<dependency>
3131
<groupId>com.github.jknack</groupId>
3232
<artifactId>handlebars</artifactId>
33-
<version>4.0.6</version>
33+
<version>4.1.0</version>
3434
</dependency>
3535
</dependencies>
3636
</project>

ext/jade/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<dependency>
3232
<groupId>de.neuland-bfi</groupId>
3333
<artifactId>jade4j</artifactId>
34-
<version>1.2.5</version>
34+
<version>1.2.7</version>
3535
</dependency>
3636
</dependencies>
3737
</project>

ext/jade/src/main/java/org/mvcspec/ozark/ext/jade/JadeOzarkConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ JadeConfiguration produce() {
9595
jade.setMode(Mode.valueOf(property(MODE).orElse("XHTML")));
9696
jade.setCaching(Boolean.valueOf(property(CACHING).orElse("true")));
9797
jade.setPrettyPrint(Boolean.valueOf(property(PRETTY_PRINT).orElse("false")));
98-
for (Map.Entry<String, Object> filter : getExtensions(FILTER_QUALIFIER).entrySet()) {
98+
getExtensions(FILTER_QUALIFIER).entrySet().forEach(filter -> {
9999
jade.setFilter(filter.getKey(), (Filter) filter.getValue());
100-
}
100+
});
101101
jade.setSharedVariables(getExtensions(HELPER_QUALIFIER));
102102
String encoding = property(ENCODING).orElse("UTF-8");
103103
jade.setTemplateLoader(new ServletContextTemplateLoader(servletContext, encoding));

0 commit comments

Comments
 (0)