list() {
28 | return todoService.findAll();
29 | }
30 |
31 | @RequestMapping(method = RequestMethod.POST)
32 | @ResponseStatus(HttpStatus.CREATED)
33 | public void add(String title) {
34 | todoService.add(title);
35 | }
36 |
37 | @RequestMapping(value = "/{id}", method = RequestMethod.GET)
38 | @ResponseStatus(HttpStatus.OK)
39 | public @ResponseBody
40 | Todo get(@PathVariable("id") Long id) {
41 | return todoService.findOne(id);
42 | }
43 |
44 | @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
45 | @ResponseStatus(HttpStatus.NO_CONTENT)
46 | public void delete(@PathVariable("id") Long id) {
47 | todoService.delete(id);
48 | }
49 |
50 | @RequestMapping(value = "/{id}/title", method = RequestMethod.PUT)
51 | @ResponseStatus(HttpStatus.NO_CONTENT)
52 | public void updateTitle(@PathVariable("id") Long id, String title) {
53 | todoService.updateTitle(id, title);
54 | }
55 |
56 | @RequestMapping(value = "/{id}/done", method = RequestMethod.PUT)
57 | @ResponseStatus(HttpStatus.NO_CONTENT)
58 | public void done(@PathVariable("id") Long id) {
59 | todoService.done(id);
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/java/example/web/WebConfiguration.java:
--------------------------------------------------------------------------------
1 | package example.web;
2 |
3 | import org.springframework.beans.factory.annotation.Autowired;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.context.annotation.Scope;
7 |
8 | import example.domain.shared.security.AuthenticatedUserDetailsProvider;
9 |
10 | @Configuration
11 | public class WebConfiguration {
12 |
13 | @Autowired
14 | private AuthenticatedUserDetailsProvider userProvider;
15 |
16 | @Bean
17 | @Scope("session")
18 | public String loggedUserDisplayName() {
19 | return userProvider.authenticated().getFullname();
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-domain-iam.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-domain-shared.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-domain-todo.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-domain.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-infrastructure-cache.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-infrastructure-common.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-infrastructure-date.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-infrastructure-events.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-infrastructure-jackson.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-infrastructure-jms.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
21 |
22 |
23 |
24 |
25 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-infrastructure-jmx.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 | true
46 | true
47 | true
48 | true
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-infrastructure-jpa.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
45 |
46 |
47 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-infrastructure-security.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-infrastructure.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-properties.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/META-INF/spring/applicationContext-web.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/application-local.properties:
--------------------------------------------------------------------------------
1 | jpa.driver=com.mysql.jdbc.Driver
2 | jpa.url=jdbc:mysql://localhost/example-spring
3 | jpa.username=example
4 | jpa.password=example
5 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/application-remote.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mkuthan/example-spring/02dddda08af40f2a33b2a976c6178e830567cdde/example-spring-core/src/main/resources/application-remote.properties
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/application.properties:
--------------------------------------------------------------------------------
1 | jpa.database=MYSQL
2 | jpa.showSql=false
3 | jpa.generateDdl=true
4 |
5 | jms.initialRedeliveryDelay=1000
6 | jms.backOffMultiplier=2.0
7 | jms.maximumRedeliveries=10
8 |
9 | mvc.resourcesCachePeriod=0
10 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/ehcache.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
10 |
11 |
17 |
18 |
25 |
26 |
33 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/logback-local.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/logback-remote.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/logback.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Example
4 |
5 |
6 | true
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/messages.properties:
--------------------------------------------------------------------------------
1 | application_name=Example
2 | application_version=${project.version}
3 | application_buildDdate=${example.buildDate}
4 |
5 | application_copyright=© Marcin Kuthan 2013
6 |
7 | #exception
8 | exception_details=Details
9 | exception_date=Date:
10 | exception_type=Type:
11 | exception_request_uri=Request URI:
12 | exception_status_code=Status code:
13 | exception_user_agent=User agent:
14 | exception_stacktrace=Stack Trace:
15 |
16 | #dataAccessFailure_jsp
17 | error_dataaccessfailure_title=Data access failure
18 | error_dataaccessfailure_description=Sorry, a problem occurred while accessing the database.
19 |
20 | #resourceNotFound_jsp
21 | error_resourcenotfound_title=Resource Not Found
22 | error_resourcenotfound_description=Sorry, we did not find the resource you were looking for.
23 |
24 | #uncaughtException_jsp
25 | error_uncaughtexception_title=Internal Error
26 | error_uncaughtexception_description=Sorry, we encountered an internal error.
27 |
28 | #security
29 | security_login_title=Login
30 | security_login_form_legend=Login
31 | security_login_form_username_label=Username:
32 | security_login_form_username_message=Enter your username
33 | security_login_form_password_label=Password:
34 | security_login_form_password_message=Enter your password
35 | security_login_form_button=Login
36 | security_login_unsuccessful=Your login attempt was not successful, try again.
37 | security_logout=Logout
38 | security_logged_out_title=Logged Out
39 | security_logged_out_message=You have been successfully logged out.
40 | security_logged_out_again=Log in again
41 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/resources/orm.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/example-spring-core/src/main/webapp/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Example Spring Application
4 |
5 |
6 |
7 |
8 | The application you are looking for is hosted on http://localhost:9000/404.html.
9 | You will be redirected to the new location automatically in 5 seconds.
10 |
11 |
12 |