Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Mic
committed
Sep 28, 2012
1 parent
3ef3457
commit 3a58e12
Showing
14 changed files
with
137 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:context="http://www.springframework.org/schema/context" | ||
xmlns:mvc="http://www.springframework.org/schema/mvc" | ||
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd | ||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd | ||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> | ||
|
||
|
||
<!-- Scans the classpath of this application for @Components to deploy as beans --> | ||
<context:component-scan base-package="controller" /> | ||
|
||
<!-- Configures the @Controller programming model --> | ||
<mvc:annotation-driven /> | ||
|
||
<!-- Resolves view names to protected .jsp resources within the /WEB-INF/views directory --> | ||
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" > | ||
<property name="prefix" value="/WEB-INF/view/jsp/"/> | ||
<property name="suffix" value=".jsp"/> | ||
<property name="order" value="2"/> | ||
</bean> | ||
|
||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<beans xmlns="http://www.springframework.org/schema/beans" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" | ||
xmlns:mvc="http://www.springframework.org/schema/mvc" | ||
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd | ||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd | ||
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> | ||
|
||
|
||
<bean id="templateResolver" | ||
class="org.thymeleaf.templateresolver.ServletContextTemplateResolver"> | ||
<property name="prefix" value="/WEB-INF/view/" /> | ||
<property name="suffix" value=".html" /> | ||
<property name="templateMode" value="HTML5" /> | ||
<property name="cacheable" value="false" /> | ||
</bean> | ||
<bean id="templateEngine" class="org.thymeleaf.spring3.SpringTemplateEngine"> | ||
<property name="templateResolver" ref="templateResolver" /> | ||
</bean> | ||
<bean class="org.thymeleaf.spring3.view.ThymeleafViewResolver"> | ||
<property name="templateEngine" ref="templateEngine" /> | ||
<property name="order" value="1" /> | ||
</bean> | ||
|
||
</beans> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | ||
|
||
<c:url value="/users/all/jsp-plain.htm" var="usersPlain" /> | ||
<c:url value="/users/all/custom-tags.htm" var="usersCustomTags" /> | ||
<c:url value="/users/all/tiles.htm" var="usersTiles" /> | ||
<c:url value="/users/all/thymeleaf.htm" var="usersThymeleaf" /> | ||
<c:url value="/images/springsource_banner_green.png" var="headerImage" /> | ||
<div class="header well"> | ||
<img src="${headerImage}"> | ||
<img src="${headerImage}"/> | ||
<div class="page-header"> | ||
<h1>MVC Layout Samples</h1> | ||
<h1>${title}</h1> | ||
</div> | ||
<ul> | ||
<li><a href="${usersPlain}">No template</a></li> | ||
<li><a href="${usersCustomTags}">Custom tags</a></li> | ||
<li><a href="${usersTiles}">Apache Tiles</a></li> | ||
<li><a href="${usersThymeleaf}">Thymeleaf</a></li> | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:th="http://www.thymeleaf.org"> | ||
<head id="headerFragment" th:fragment="headerFragment"> | ||
|
||
<div class="header well"> | ||
<img th:src="@{/images/springsource_banner_green.png}"/> | ||
<link th:src="@{/style/app.css}" rel="stylesheet"/> | ||
<div class="page-header"> | ||
<h1 th:text="${title}"/> | ||
</div> | ||
<ul> | ||
<li><a th:href="@{/users/all/jsp-plain.htm}">No template</a></li> | ||
<li><a th:href="@{/users/all/custom-tags.htm}">Custom tags</a></li> | ||
<li><a th:href="@{/users/all/tiles.htm}">Apache Tiles</a></li> | ||
<li><a th:href="@{/users/all/thymeleaf.htm}">Thymeleaf</a></li> | ||
</ul> | ||
</div> | ||
|
||
</head> | ||
<body> | ||
<div class="container"> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html xmlns:th="http://www.thymeleaf.org"> | ||
<head th:include="thymeleaf/menu :: headerFragment"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<title>${title}</title> | ||
</head> | ||
<body> | ||
<div th:if="${#lists.isEmpty(users)}"> | ||
Table is empty. | ||
</div> | ||
<div th:if="${not #lists.isEmpty(users)}"> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th> First Name </th> | ||
<th> Last name </th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr th:each="user : ${users}"> | ||
<td th:text="${user.firstName}">John</td> | ||
<td th:text="${user.lastName}">Smith</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters