You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+69-3
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,60 @@
2
2
3
3
Spring MVC Cache Control is an extension to [Spring MVC][spring_mvc] that aims to simplify implementing HTTP/1.1 Cache-Control headers for annotated MVC controllers.
4
4
5
-
## Checkout and Build from Source
5
+
## Usage
6
+
7
+
### Add Spring MVC Cache Control as a dependency to your project.
Use the `@CacheControl` annoation on either (or both) type level `@Controller`s or method level `@RequestMapping`s. The handler interceptor will read the annotations and generate HTTP/1.1 complaint cache-control headers. For example:
39
+
40
+
```
41
+
@Controller
42
+
public final class DemoController {
43
+
44
+
/**
45
+
* Public home page, cacheable for 5 minutes.
46
+
*/
47
+
@CacheControl(maxAge = 300)
48
+
@RequestMapping({"/", "/home.do"})
49
+
public String handleHomePageRequest(Model model) {
50
+
...
51
+
}
52
+
}
53
+
```
54
+
55
+
See our [spring-mvc-cache-control-demo][demo] project for full details.
56
+
57
+
58
+
## Building from Source
6
59
7
60
1. Clone the repository from GitHub:
8
61
@@ -16,7 +69,14 @@ Spring MVC Cache Control is an extension to [Spring MVC][spring_mvc] that aims t
16
69
17
70
$ ./gradlew build
18
71
19
-
## Eclipse
72
+
## IDE Integration
73
+
74
+
### IntelliJ IDEA
75
+
76
+
IDEA 13+ natively support Gralde projects. Simply choose to import an existing project and select
77
+
the build.gradle file. Tick the checkbox to use the Gradle wrapper.
78
+
79
+
### Eclipse
20
80
21
81
To generate Eclipse metadata (.classpath and .project files), use the following Gradle task:
22
82
@@ -32,8 +92,14 @@ Use the following Gradle task to build the JavaDoc
32
92
33
93
$ ./gradlew javadoc
34
94
35
-
_Note: The result will be available in 'docs/build/api'._
95
+
_Note: The result will be available in 'spring-mvc-cache-control/build/docs/javadoc'._
96
+
97
+
## Contributing
98
+
99
+
Contributions are always welcome. Fork the repository, create a topic branch and send a pull request.
0 commit comments