Explorar el Código

Add title in front of source code includes

Greg Turnquist hace 13 años
padre
commit
385c8f2d32
Se han modificado 2 ficheros con 4 adiciones y 0 borrados
  1. 3
    0
      README.disable_asc
  2. 1
    0
      macros/create_both_builds.asc

+ 3
- 0
README.disable_asc Ver fichero

@@ -77,6 +77,7 @@ The `id` field is a unique identifier for the greeting, and `content` is the tex
77 77
 
78 78
 To model the greeting representation, you create a resource representation class. Provide a plain old java object with fields, constructors, and accessors for the `id` and `content` data:
79 79
 
80
+.src/main/java/hello/Greeting.java
80 81
 [source,java]
81 82
 ----
82 83
 include::complete/src/main/java/hello/Greeting.java[]
@@ -91,6 +92,7 @@ Next you create the resource controller that will serve these greetings.
91 92
 
92 93
 In Spring's approach to building RESTful web services, HTTP requests are handled by a controller. These components are easily identified by the http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/stereotype/Controller.html[`@Controller`] annotation, and the `GreetingController` below handles `GET` requests for `/greeting` by returning a new instance of the `Greeting` class:
93 94
 
95
+.src/main/java/hello/GreetingController.java
94 96
 [source,java]
95 97
 ----
96 98
 include::complete/src/main/java/hello/GreetingController.java[]
@@ -118,6 +120,7 @@ The `Greeting` object must be converted to JSON. Thanks to Spring's HTTP message
118 120
 Although it is possible to package this service as a traditional link:/understanding/WAR[WAR] file for deployment to an external application server, the simpler approach demonstrated below creates a standalone application. You package everything in a single, executable JAR file, driven by a good old Java `main()` method. Along the way, you use Spring's support for embedding the link:/understanding/Tomcat[Tomcat] servlet container as the HTTP runtime, instead of deploying to an external instance.
119 121
 
120 122
 
123
+.src/main/java/hello/Application.java
121 124
 [source,java]
122 125
 ----
123 126
 include::complete/src/main/java/hello/Application.java[]

+ 1
- 0
macros/create_both_builds.asc Ver fichero

@@ -6,6 +6,7 @@
6 6
 === Create a Gradle build file
7 7
 Below is the https://github.com/spring-guides/{project_id}/blob/master/initial/build.gradle[initial Gradle build file]. But you can also use Maven. The pom.xml file is included https://github.com/spring-guides/{project_id}/blob/master/initial/pom.xml[right here]. If you are using link:/guides/gs/sts[Spring Tool Suite (STS)], you can import the guide directly.
8 8
 
9
+.build.gradle
9 10
 // AsciiDoc source formatting doesn't support groovy, so using java instead
10 11
 [source,java]
11 12
 ----