|
|
@@ -5,14 +5,21 @@
|
|
5
|
5
|
What you'll build
|
|
6
|
6
|
-----------------
|
|
7
|
7
|
|
|
8
|
|
-This guide will take you through creating a "hello world" [RESTful web service](/understanding/REST) with Spring—literally, we'll build a service that accepts an HTTP GET request:
|
|
9
|
|
-```
|
|
10
|
|
-$ curl http://localhost:8080/hello-world
|
|
11
|
|
-```
|
|
12
|
|
-and responds with the following [JSON](/understanding/JSON):
|
|
13
|
|
-```
|
|
14
|
|
-{"id":1,"content":"Hello, World!"}
|
|
15
|
|
-```
|
|
|
8
|
+This guide will walk you through creating a "hello world" [RESTful web service][u-rest] with Spring. The service will accept HTTP GET requests at:
|
|
|
9
|
+
|
|
|
10
|
+ http://localhost:8080/greeting
|
|
|
11
|
+
|
|
|
12
|
+and respond with a [JSON][u-json] representation of a greeting:
|
|
|
13
|
+
|
|
|
14
|
+ {"id":1,"content":"Hello, World!"}
|
|
|
15
|
+
|
|
|
16
|
+You'll also be able to customize the greeting by providing an optional `name` parameter in the query string:
|
|
|
17
|
+
|
|
|
18
|
+ http://localhost:8080/greeting?name=User
|
|
|
19
|
+
|
|
|
20
|
+this will override the default value of "World" and be reflected in the response:
|
|
|
21
|
+
|
|
|
22
|
+ {"id":1,"content":"Hello, User!"}
|
|
16
|
23
|
|
|
17
|
24
|
|
|
18
|
25
|
What you'll need
|
|
|
@@ -20,9 +27,8 @@ What you'll need
|
|
20
|
27
|
|
|
21
|
28
|
- About 15 minutes
|
|
22
|
29
|
- A favorite text editor or IDE
|
|
23
|
|
- - [JDK 7][jdk7] or later
|
|
24
|
|
- - Your choice of Maven (3.0+) or Gradle (1.5+)
|
|
25
|
|
-
|
|
|
30
|
+ - [JDK 6][jdk] or later
|
|
|
31
|
+ - [Maven 3.0][mvn] or later
|
|
26
|
32
|
|
|
27
|
33
|
[macro:how-to-complete-this-guide]
|
|
28
|
34
|
|
|
|
@@ -30,11 +36,17 @@ What you'll need
|
|
30
|
36
|
<a name="scratch"></a>
|
|
31
|
37
|
Set up the project
|
|
32
|
38
|
------------------
|
|
|
39
|
+
|
|
33
|
40
|
[macro:build-system-intro]
|
|
34
|
41
|
|
|
35
|
|
-<span class="maven">
|
|
|
42
|
+### Create the directory structure
|
|
|
43
|
+
|
|
|
44
|
+ mkdir -p src/main/java/hello
|
|
|
45
|
+
|
|
36
|
46
|
### Create a Maven POM
|
|
37
|
47
|
|
|
|
48
|
+[macro:maven-project-setup-options]
|
|
|
49
|
+
|
|
38
|
50
|
`pom.xml`
|
|
39
|
51
|
```xml
|
|
40
|
52
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
@@ -82,61 +94,26 @@ Set up the project
|
|
82
|
94
|
```
|
|
83
|
95
|
|
|
84
|
96
|
[macro:bootstrap-starter-pom-disclaimer]
|
|
85
|
|
-</span>
|
|
86
|
|
-
|
|
87
|
|
-<span class="gradle">
|
|
88
|
|
-### Create a Gradle build script
|
|
89
|
|
-`build.gradle`
|
|
90
|
|
-```groovy
|
|
91
|
|
-TODO: paste complete build.gradle.
|
|
92
|
|
-compile "org.springframework.bootstrap:spring-bootstrap-web-starter:0.0.1-SNAPSHOT"
|
|
93
|
|
-compile "com.fasterxml.jackson.core:jackson-databind:2.2.0-"
|
|
94
|
|
-```
|
|
95
|
|
-</span>
|
|
96
|
|
-
|
|
97
|
|
-
|
|
98
|
|
-Create a configuration class
|
|
99
|
|
-----------------------------
|
|
100
|
|
-The first step is to set up a simple Spring configuration class. It'll look like this:
|
|
101
|
|
-
|
|
102
|
|
-`src/main/java/hello/HelloWorldConfiguration.java`
|
|
103
|
|
-
|
|
104
|
|
-```java
|
|
105
|
|
-package hello;
|
|
106
|
|
-
|
|
107
|
|
-import org.springframework.context.annotation.ComponentScan;
|
|
108
|
|
-import org.springframework.context.annotation.Configuration;
|
|
109
|
|
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
|
110
|
|
-
|
|
111
|
|
-@Configuration
|
|
112
|
|
-@EnableWebMvc
|
|
113
|
|
-@ComponentScan
|
|
114
|
|
-public class HelloWorldConfiguration {
|
|
115
|
|
-}
|
|
116
|
|
-```
|
|
117
|
|
-
|
|
118
|
|
-This class is concise, but there's plenty going on under the hood. [`@EnableWebMvc`](http://static.springsource.org/spring/docs/3.2.x/javadoc-api/org/springframework/web/servlet/config/annotation/EnableWebMvc.html) handles the registration of a number of components that enable Spring's support for annotation-based controllers—you'll build one of those in an upcoming step. And we've also annotated the configuration class with [`@ComponentScan`](http://static.springsource.org/spring/docs/3.2.x/javadoc-api/org/springframework/context/annotation/ComponentScan.html) which tells Spring to scan the `hello` package for those controllers (along with any other annotated component classes).
|
|
119
|
97
|
|
|
120
|
98
|
|
|
121
|
99
|
<a name="initial"></a>
|
|
122
|
100
|
Create a resource representation class
|
|
123
|
101
|
--------------------------------------
|
|
124
|
|
-With the essential Spring MVC configuration out of the way, it's time to get to the nuts and bolts of our REST service by creating a resource representation class and an endpoint controller.
|
|
125
|
102
|
|
|
126
|
|
-Before we get too carried away with building the endpoint controller, we need to give some thought to what our API will look like.
|
|
|
103
|
+With the basics of setting up the project and build system out of the way, it's time to get to the nuts and bolts of creating our service.
|
|
127
|
104
|
|
|
128
|
|
-What we want is to handle GET requests for /hello-world, optionally with a name query parameter. In response to such a request, we'd like to send back JSON, representing a greeting, that looks something like this:
|
|
|
105
|
+It's best to begin this process by thinking about what interacting with the service will look like.
|
|
129
|
106
|
|
|
130
|
|
-```json
|
|
131
|
|
-{
|
|
132
|
|
- "id": 1,
|
|
133
|
|
- "content": "Hello, World!"
|
|
134
|
|
-}
|
|
135
|
|
-```
|
|
|
107
|
+We want to handle `GET` requests for `/greeting`, optionally with a `name` parameter in the query string. In response to such a request, we'd like to send back a `200 OK` response with JSON in the body that represents a greeting. It should look something like this:
|
|
|
108
|
+
|
|
|
109
|
+ {
|
|
|
110
|
+ "id": 1,
|
|
|
111
|
+ "content": "Hello, World!"
|
|
|
112
|
+ }
|
|
136
|
113
|
|
|
137
|
114
|
The `id` field is a unique identifier for the greeting, and `content` is the textual representation of the greeting.
|
|
138
|
115
|
|
|
139
|
|
-To model the greeting representation, create a representation class:
|
|
|
116
|
+To model the greeting representation, we'll create a _resource representation class_. There's nothing fancy about this step—we're just creating a plain old java object with fields, constructors and accessors for the `id` and `content` data:
|
|
140
|
117
|
|
|
141
|
118
|
`src/main/java/hello/Greeting.java`
|
|
142
|
119
|
```java
|
|
|
@@ -162,49 +139,66 @@ public class Greeting {
|
|
162
|
139
|
}
|
|
163
|
140
|
```
|
|
164
|
141
|
|
|
165
|
|
-Now that we've got our representation class, let's create the endpoint controller that will serve it.
|
|
|
142
|
+As you'll see in a moment, Spring will the use _Jackson_ library to automatically marshal instances of type `Greeting` into JSON.
|
|
|
143
|
+
|
|
|
144
|
+Now that we've got our representation class, let's create the resource controller that will serve it.
|
|
166
|
145
|
|
|
167
|
146
|
|
|
168
|
147
|
Create a resource controller
|
|
169
|
148
|
------------------------------
|
|
170
|
|
-In Spring, REST endpoints are just Spring MVC controllers. The following Spring MVC controller handles a GET request for /hello-world and returns our `Greeting` resource:
|
|
171
|
149
|
|
|
172
|
|
-`src/main/java/hello/HelloWorldController.java`
|
|
|
150
|
+In Spring's approach to building RESTful web services, HTTP requests are handled by a _controller_. These components are are easily identified by the [`@Controller`][] annotation, and the `GreetingController` below handles `GET` requests for `/greeting` by returning a new instance of our `Greeting` class:
|
|
|
151
|
+
|
|
|
152
|
+`src/main/java/hello/GreetingController.java`
|
|
173
|
153
|
```java
|
|
174
|
154
|
package hello;
|
|
|
155
|
+
|
|
175
|
156
|
import java.util.concurrent.atomic.AtomicLong;
|
|
176
|
157
|
import org.springframework.stereotype.Controller;
|
|
177
|
158
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
178
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
179
|
159
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
180
|
160
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
181
|
161
|
|
|
182
|
162
|
@Controller
|
|
183
|
|
-@RequestMapping("/hello-world")
|
|
184
|
|
-public class HelloWorldController {
|
|
|
163
|
+public class GreetingController {
|
|
185
|
164
|
|
|
186
|
165
|
private static final String template = "Hello, %s!";
|
|
187
|
166
|
private final AtomicLong counter = new AtomicLong();
|
|
188
|
167
|
|
|
189
|
|
- @RequestMapping(method=RequestMethod.GET)
|
|
190
|
|
- public @ResponseBody Greeting sayHello(
|
|
|
168
|
+ @RequestMapping("/greeting")
|
|
|
169
|
+ public @ResponseBody Greeting greeting(
|
|
191
|
170
|
@RequestParam(value="name", required=false, defaultValue="World") String name) {
|
|
192
|
|
- return new Greeting(counter.incrementAndGet(), String.format(template, name));
|
|
|
171
|
+ return new Greeting(counter.incrementAndGet(),
|
|
|
172
|
+ String.format(template, name));
|
|
193
|
173
|
}
|
|
194
|
174
|
}
|
|
195
|
175
|
```
|
|
196
|
176
|
|
|
197
|
|
-The key difference between a human-facing controller and a REST endpoint controller is in how the response is created. Rather than rely on a view (such as a [JSP](/understanding/JSP)) to render model data in HTML, an endpoint controller simply returns the data to be written directly to the body of the response.
|
|
|
177
|
+This controller is concise and simple, but there's plenty going on under the hood. Let's break it down step by step.
|
|
|
178
|
+
|
|
|
179
|
+The `@RequestMapping` annotation ensures that HTTP requests to `/greeting` are mapped to the `greeting()` method.
|
|
|
180
|
+
|
|
|
181
|
+[admon:note] We have not explicitly specified `GET` vs. `PUT`, `POST`, etc. above, because `@RequestMapping` maps _all_ HTTP operations by default. Use `@RequestMapping(method=GET)` to narrow this down.
|
|
|
182
|
+
|
|
|
183
|
+`@RequestParam` binds the value of the query string parameter `name` into the `name` parameter of the `greeting()` method. This query string parameter is not `required`, so if absent in the request the `defaultValue` of "World" will be used.
|
|
|
184
|
+
|
|
|
185
|
+The implementation of the method body is straightforward—create and return a new `Greeting` object with `id` and `content` attributes based on the next value from our `counter` and formatting the given `name` using our greeting `template`.
|
|
|
186
|
+
|
|
|
187
|
+One key difference between a traditional MVC controller and the RESTful web service controller above is in the way the HTTP response body is created. Rather than relying on a view technology (such as [JSP][u-jsp]) to perform server-side rendering of our greeting data to HTML, this service controller simply populates and returns a `Greeting` object, with the goal that its data is written directly to the HTTP response as JSON.
|
|
|
188
|
+
|
|
|
189
|
+The [`@ResponseBody`][] annotation helps make this happen. The presence of this annotation on the `greeting()` method tells Spring MVC that it does not need to render the greeting object through a server-side view layer, but that instead that the greeting object returned _is_ the response body, and should be written out directly.
|
|
|
190
|
+
|
|
|
191
|
+The only step that remains is converting the `Greeting` object to JSON. And fortunately, thanks to Spring's _HTTP message converter_ support, we don't need to bother with doing this conversion by hand. Because [Jackson 2][jackson] is on the classpath, Spring's [`MappingJackson2HttpMessageConverter`][] is automatically chosen to convert the `Greeting` instance to JSON.
|
|
198
|
192
|
|
|
199
|
|
-The magic is in the [`@ResponseBody`](http://static.springsource.org/spring/docs/3.2.x/javadoc-api/org/springframework/web/bind/annotation/ResponseBody.html) annotation. `@ResponseBody` tells Spring MVC to not render a model into a view, but rather to write the returned object into the response body. It does this by using one of Spring's message converters. Because Jackson 2 is on the classpath, Spring's [`MappingJackson2HttpMessageConverter`](http://static.springsource.org/spring/docs/3.2.x/javadoc-api/org/springframework/http/converter/json/MappingJackson2HttpMessageConverter.html) is automatically chosen to convert the Greeting instance to JSON.
|
|
200
|
193
|
|
|
|
194
|
+Make the application executable
|
|
|
195
|
+-------------------------------
|
|
201
|
196
|
|
|
202
|
|
-Create an executable main class
|
|
203
|
|
----------------------------------
|
|
|
197
|
+While it is possible to package this service up as a traditional _web application archive_ or [WAR][u-war] file for deployment to an external application server, we demonstrate below the simpler approach of creating a _standalone application_. You'll package everything up a single, executable JAR file, driven by a good old Java `main()` method. And along the way, we'll use Spring's support for embedding the [Tomcat][u-tomcat] servlet container as the HTTP runtime, instead of deploying to an external instance.
|
|
204
|
198
|
|
|
205
|
|
-We can launch the application from a custom main class, or we can do that directly from one of the configuration classes. The easiest way is to use the `SpringApplication` helper class:
|
|
|
199
|
+### Create a main class
|
|
206
|
200
|
|
|
207
|
|
-`src/main/java/hello/HelloWorldConfiguration.java`
|
|
|
201
|
+`src/main/java/hello/ServiceMain.java`
|
|
208
|
202
|
|
|
209
|
203
|
```java
|
|
210
|
204
|
package hello;
|
|
|
@@ -212,101 +206,100 @@ package hello;
|
|
212
|
206
|
import org.springframework.bootstrap.SpringApplication;
|
|
213
|
207
|
import org.springframework.bootstrap.context.annotation.EnableAutoConfiguration;
|
|
214
|
208
|
import org.springframework.context.annotation.ComponentScan;
|
|
215
|
|
-import org.springframework.context.annotation.Configuration;
|
|
216
|
|
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
|
217
|
209
|
|
|
218
|
|
-@Configuration
|
|
219
|
|
-@EnableAutoConfiguration
|
|
220
|
|
-@EnableWebMvc
|
|
221
|
210
|
@ComponentScan
|
|
222
|
|
-public class HelloWorldConfiguration {
|
|
|
211
|
+@EnableAutoConfiguration
|
|
|
212
|
+public class ServiceMain {
|
|
|
213
|
+
|
|
223
|
214
|
public static void main(String[] args) {
|
|
224
|
|
- SpringApplication.run(HelloWorldConfiguration.class, args);
|
|
|
215
|
+ SpringApplication.run(ServiceMain.class, args);
|
|
225
|
216
|
}
|
|
226
|
217
|
}
|
|
227
|
218
|
```
|
|
|
219
|
+The `main()` method defers to the [`SpringApplication`][] helper class, providing `ServiceMain.class` as an argument to its `run()` method. This tells Spring to read the annotation metadata from `ServiceMain` and to manage it as a component in the _[Spring application context][u-application-context]_.
|
|
|
220
|
+
|
|
|
221
|
+The `@ComponentScan` annotation tells Spring to recursively search through the `hello` package and its children for classes marked directly or indirectly with Spring's [`@Component`][] annotation. This directive ensures that Spring will find and register our `GreetingController`, because it is marked with `@Controller`, which in turn is a kind of `@Component` annotation.
|
|
|
222
|
+
|
|
|
223
|
+The [`@EnableAutoConfiguration`][] annotation has also been added: it switches on a number of reasonable default behaviors based on the content of your classpath. For example, because the application depends on the embeddable version of Tomcat (tomcat-embed-core.jar), a Tomcat server is set up and configured with reasonable defaults on your behalf. And because the application also depends on Spring MVC (spring-webmvc.jar), a Spring MVC [`DispatcherServlet`][] is configured and registered for you—no `web.xml` necessary! Auto-configuration is a powerful, flexible mechanism—See the [API documentation][`@EnableAutoConfiguration`] for further details.
|
|
228
|
224
|
|
|
229
|
|
-The `@EnableAutoConfiguration` annotation has also been added: it provides a load of defaults (like the embedded servlet container) depending on the contents of your classpath, and other things.
|
|
|
225
|
+### Build an executable JAR
|
|
230
|
226
|
|
|
|
227
|
+Now that we have our `ServiceMain` class ready to go, we simply need to instruct the build system to create a single, executable jar containing everything. This will make it dead simple to ship and version and deploy the service as an application throughout the development lifecycle, across different environments, etc.
|
|
231
|
228
|
|
|
232
|
|
-Build an executable JAR
|
|
233
|
|
------------------------
|
|
234
|
|
-<span class="maven">
|
|
235
|
|
-Add the following to your `pom.xml` file (keeping any existing properties or plugins intact):
|
|
|
229
|
+Add the following configuration to your existing Maven POM
|
|
236
|
230
|
|
|
237
|
231
|
`pom.xml`
|
|
238
|
232
|
```xml
|
|
239
|
|
-<properties>
|
|
240
|
|
- <start-class>hello.HelloWorldConfiguration</start-class>
|
|
241
|
|
-</properties>
|
|
242
|
|
-
|
|
243
|
|
-<build>
|
|
244
|
|
- <plugins>
|
|
245
|
|
- <plugin>
|
|
246
|
|
- <groupId>org.apache.maven.plugins</groupId>
|
|
247
|
|
- <artifactId>maven-shade-plugin</artifactId>
|
|
248
|
|
- </plugin>
|
|
249
|
|
- </plugins>
|
|
250
|
|
-</build>
|
|
|
233
|
+ <properties>
|
|
|
234
|
+ <start-class>hello.ServiceMain</start-class>
|
|
|
235
|
+ </properties>
|
|
|
236
|
+
|
|
|
237
|
+ <build>
|
|
|
238
|
+ <plugins>
|
|
|
239
|
+ <plugin>
|
|
|
240
|
+ <groupId>org.apache.maven.plugins</groupId>
|
|
|
241
|
+ <artifactId>maven-shade-plugin</artifactId>
|
|
|
242
|
+ </plugin>
|
|
|
243
|
+ </plugins>
|
|
|
244
|
+ </build>
|
|
251
|
245
|
```
|
|
252
|
|
-</span>
|
|
253
|
|
-<span class="gradle">
|
|
254
|
|
-```groovy
|
|
255
|
|
-TODO: gradle syntax
|
|
256
|
|
-```
|
|
257
|
|
-</span>
|
|
258
|
246
|
|
|
259
|
|
-The following will produce a single executable JAR file containing all necessary dependency classes:
|
|
260
|
|
-<span class="maven">
|
|
261
|
|
-```
|
|
262
|
|
-$ mvn package
|
|
263
|
|
-```
|
|
264
|
|
-</span>
|
|
265
|
|
-<span class="gradle">
|
|
266
|
|
-```
|
|
267
|
|
-$ gradle build
|
|
268
|
|
-```
|
|
269
|
|
-</span>
|
|
|
247
|
+The `start-class` property tells Maven to create a `META-INF/MANIFEST.MF` file with a `Main-Class: hello.ServiceMain` entry. This is the key to being able to run the jar with `java -jar`.
|
|
|
248
|
+
|
|
|
249
|
+The [Maven Shade plugin][maven-shade-plugin] extracts classes from all the jars on the classpath and builds a single "über-jar". This makes it much more convenient to execute and transport your service.
|
|
|
250
|
+
|
|
|
251
|
+Now run the following to produce a single executable JAR file containing all necessary dependency classes and resources:
|
|
|
252
|
+
|
|
|
253
|
+ mvn package
|
|
270
|
254
|
|
|
271
|
255
|
|
|
272
|
256
|
Run the service
|
|
273
|
257
|
---------------
|
|
274
|
258
|
|
|
275
|
|
-Now you can run it from the jar as well, and distribute that as an executable artifact:
|
|
276
|
|
-```
|
|
277
|
|
-$ java -jar target/gs-rest-service-1.0.jar
|
|
|
259
|
+That's it! You're ready to run your service with `java -jar` at the command line:
|
|
278
|
260
|
|
|
279
|
|
-```
|
|
|
261
|
+ java -jar target/gs-rest-service-1.0.jar
|
|
|
262
|
+
|
|
|
263
|
+You'll see a bit of logging output, and the service should be up and running within a second or two.
|
|
280
|
264
|
|
|
281
|
265
|
|
|
282
|
266
|
Test the service
|
|
283
|
267
|
----------------
|
|
284
|
268
|
|
|
285
|
|
-Once the service starts, you can test it by pointing your web browser at <http://localhost:8080/hello-world>. Or you can consume it from the command line using [`curl`][curl]:
|
|
|
269
|
+Now that the service is up, visit <http://localhost:8080/greeting>, where you'll see
|
|
286
|
270
|
|
|
287
|
|
-```
|
|
288
|
|
-$ curl http://localhost:8080/hello-world
|
|
289
|
|
-```
|
|
|
271
|
+ {"id":1,"content":"Hello, World!"}
|
|
290
|
272
|
|
|
291
|
|
-Either way, the response should look like this:
|
|
292
|
|
-```
|
|
293
|
|
-{"id":1,"content":"Hello, World!"}
|
|
294
|
|
-```
|
|
|
273
|
+Try providing a `name` query string parameter with <http://localhost:8080/greeting?name=User>. Notice how the value of the `content` attribute changes from "Hello, World!" to "Hello User!":
|
|
295
|
274
|
|
|
296
|
|
-Now try providing a `name` query string parameter: <http://localhost:8080/hello-world?name=User>
|
|
|
275
|
+ {"id":2,"content":"Hello, User!"}
|
|
297
|
276
|
|
|
298
|
|
-```
|
|
299
|
|
-$ curl http://localhost:8080/hello-world?name=User
|
|
300
|
|
-```
|
|
|
277
|
+This demonstrates that the `@RequestParam` arrangement in `GreetingController` is working as expected. The `name` parameter has been given a default value of "World", but can always be explicitly overridden through the query string.
|
|
301
|
278
|
|
|
302
|
|
-And notice how the content changes:
|
|
|
279
|
+Notice also how the `id` attribute has changed from `1` to `2`. This proves that we're working against the same `GreetingController` instance across multiple requests, and that its `counter` field is being incremented on each call as expected.
|
|
303
|
280
|
|
|
304
|
|
-```
|
|
305
|
|
-{"id":1,"content":"Hello, User"}
|
|
306
|
|
-```
|
|
307
|
281
|
|
|
308
|
|
-Congratulations! You have just developed a simple RESTful service using Spring. This is a basic foundation for building a complete REST API in Spring.
|
|
|
282
|
+Summary
|
|
|
283
|
+-------
|
|
|
284
|
+
|
|
|
285
|
+Congrats! You've just developed your first RESTful web service using Spring. This of course is just the beginning, and there are many more features to explore and take advantage of. Be sure to check out Spring's support for [securing](TODO), [testing](TODO), [describing](TODO) and [managing](TODO) RESTful web services.
|
|
|
286
|
+
|
|
309
|
287
|
|
|
|
288
|
+[mvn]: http://maven.apache.org/download.cgi
|
|
310
|
289
|
[zip]: https://github.com/springframework-meta/gs-rest-service/archive/master.zip
|
|
311
|
|
-[jdk7]: http://docs.oracle.com/javase/7/docs/webnotes/install/index.html
|
|
312
|
|
-[curl]: http://curl.haxx.se/download.html
|
|
|
290
|
+[jdk]: http://www.oracle.com/technetwork/java/javase/downloads/index.html
|
|
|
291
|
+[u-rest]: /understanding/rest
|
|
|
292
|
+[u-json]: /understanding/json
|
|
|
293
|
+[u-jsp]: /understanding/jsp
|
|
|
294
|
+[jackson]: http://wiki.fasterxml.com/JacksonHome
|
|
|
295
|
+[u-war]: /understanding/war
|
|
|
296
|
+[u-tomcat]: /understanding/tomcat
|
|
|
297
|
+[u-application-context]: /understanding/application-context
|
|
|
298
|
+[maven-shade-plugin]: https://maven.apache.org/plugins/maven-shade-plugin
|
|
|
299
|
+[`@Controller`]: http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/stereotype/Controller.html
|
|
|
300
|
+[`SpringApplication`]: http://static.springsource.org/spring-bootstrap/docs/0.5.0.BUILD-SNAPSHOT/javadoc-api/org/springframework/bootstrap/SpringApplication.html
|
|
|
301
|
+[`@EnableAutoConfiguration`]: http://static.springsource.org/spring-bootstrap/docs/0.5.0.BUILD-SNAPSHOT/javadoc-api/org/springframework/bootstrap/context/annotation/SpringApplication.html
|
|
|
302
|
+[`@Component`]: http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/stereotype/Component.html
|
|
|
303
|
+[`@ResponseBody`]: http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/bind/annotation/ResponseBody.html
|
|
|
304
|
+[`MappingJackson2HttpMessageConverter`]: http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/http/converter/json/MappingJackson2HttpMessageConverter.html
|
|
|
305
|
+[`DispatcherServlet`]: http://static.springsource.org/spring/docs/current/javadoc-api/org/springframework/web/servlet/DispatcherServlet.html
|