13 |
14 |
Spittle message
15 |
16 | spittle timestamp
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Chapter_06/thymeleaf/src/main/webapp/resources/images/spitter_avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/SpringInAction/422d39d34f0857af2850efebde273b9bb17d5ace/Chapter_06/thymeleaf/src/main/webapp/resources/images/spitter_avatar.png
--------------------------------------------------------------------------------
/Chapter_06/thymeleaf/src/main/webapp/resources/images/spitter_background.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/SpringInAction/422d39d34f0857af2850efebde273b9bb17d5ace/Chapter_06/thymeleaf/src/main/webapp/resources/images/spitter_background.gif
--------------------------------------------------------------------------------
/Chapter_06/thymeleaf/src/main/webapp/resources/images/spitter_logo_50.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/SpringInAction/422d39d34f0857af2850efebde273b9bb17d5ace/Chapter_06/thymeleaf/src/main/webapp/resources/images/spitter_logo_50.png
--------------------------------------------------------------------------------
/Chapter_06/thymeleaf/src/main/webapp/resources/images/spitter_me.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/SpringInAction/422d39d34f0857af2850efebde273b9bb17d5ace/Chapter_06/thymeleaf/src/main/webapp/resources/images/spitter_me.jpg
--------------------------------------------------------------------------------
/Chapter_06/thymeleaf/src/test/java/spitter/web/HomeControllerTest.java:
--------------------------------------------------------------------------------
1 | package spitter.web;
2 | import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
3 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
4 | import static org.springframework.test.web.servlet.setup.MockMvcBuilders.*;
5 |
6 | import org.junit.Test;
7 | import org.springframework.test.web.servlet.MockMvc;
8 |
9 | import spittr.web.HomeController;
10 |
11 | public class HomeControllerTest {
12 |
13 | @Test
14 | public void testHomePage() throws Exception {
15 | HomeController controller = new HomeController();
16 | MockMvc mockMvc = standaloneSetup(controller).build();
17 | mockMvc.perform(get("/"))
18 | .andExpect(view().name("home"));
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/Chapter_06/tiles/.gitignore:
--------------------------------------------------------------------------------
1 | /build/
2 | /bin/
3 | .springBeans
4 | .settings
5 | .project
6 | .classpath
7 | .gradle
8 |
--------------------------------------------------------------------------------
/Chapter_06/tiles/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Jpub/SpringInAction/422d39d34f0857af2850efebde273b9bb17d5ace/Chapter_06/tiles/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Chapter_06/tiles/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Nov 02 17:42:15 CST 2014
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-1.8-bin.zip
7 |
--------------------------------------------------------------------------------
/Chapter_06/tiles/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'Spittr-Tiles'
2 |
--------------------------------------------------------------------------------
/Chapter_06/tiles/src/main/java/spittr/config/SpitterWebInitializer.java:
--------------------------------------------------------------------------------
1 | package spittr.config;
2 |
3 | import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
4 |
5 | import spittr.web.WebConfig;
6 |
7 | public class SpitterWebInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
8 |
9 | @Override
10 | protected Class>[] getRootConfigClasses() {
11 | return new Class>[] { RootConfig.class };
12 | }
13 |
14 | @Override
15 | protected Class>[] getServletConfigClasses() {
16 | return new Class>[] { WebConfig.class };
17 | }
18 |
19 | @Override
20 | protected String[] getServletMappings() {
21 | return new String[] { "/" };
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/Chapter_06/tiles/src/main/java/spittr/data/SpitterRepository.java:
--------------------------------------------------------------------------------
1 | package spittr.data;
2 |
3 | import spittr.Spitter;
4 |
5 | public interface SpitterRepository {
6 |
7 | Spitter save(Spitter spitter);
8 |
9 | Spitter findByUsername(String username);
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/Chapter_06/tiles/src/main/java/spittr/data/SpittleRepository.java:
--------------------------------------------------------------------------------
1 | package spittr.data;
2 |
3 | import java.util.List;
4 |
5 | import spittr.Spittle;
6 |
7 | public interface SpittleRepository {
8 |
9 | List