File tree Expand file tree Collapse file tree 8 files changed +26
-137
lines changed
springboot-angular8-helloworld-example/springboot-helloworld-application
main/java/net/javaguides/springboot/Springboothelloworldapplication
test/java/net/javaguides/springboot/Springboothelloworldapplication
springboot-jsp-hello-world-example
src/main/java/net/javaguides/springboot/controller Expand file tree Collapse file tree 8 files changed +26
-137
lines changed Original file line number Diff line number Diff line change 1414 <parent >
1515 <groupId >org.springframework.boot</groupId >
1616 <artifactId >spring-boot-starter-parent</artifactId >
17- <version >2.7.13 </version >
17+ <version >3.1.1 </version >
1818 <relativePath /> <!-- lookup parent from repository -->
1919 </parent >
2020
2121 <properties >
2222 <project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
2323 <project .reporting.outputEncoding>UTF-8</project .reporting.outputEncoding>
24- <java .version>1.8 </java .version>
24+ <java .version>17 </java .version>
2525 </properties >
2626
2727 <dependencies >
2828 <dependency >
2929 <groupId >org.springframework.boot</groupId >
3030 <artifactId >spring-boot-starter-web</artifactId >
3131 </dependency >
32+ <dependency >
33+ <groupId >org.glassfish.jaxb</groupId >
34+ <artifactId >jaxb-runtime</artifactId >
35+ <scope >test</scope >
36+ </dependency >
3237
3338 <dependency >
3439 <groupId >org.springframework.boot</groupId >
Original file line number Diff line number Diff line change 33import java .util .concurrent .atomic .AtomicLong ;
44
55import org .springframework .web .bind .annotation .CrossOrigin ;
6+ import org .springframework .web .bind .annotation .GetMapping ;
67import org .springframework .web .bind .annotation .RequestMapping ;
78import org .springframework .web .bind .annotation .RequestParam ;
89import org .springframework .web .bind .annotation .RestController ;
@@ -15,8 +16,8 @@ public class GreetingController {
1516 private static final String template = "Hello, %s!" ;
1617 private final AtomicLong counter = new AtomicLong ();
1718
18- @ RequestMapping ("/greeting" )
19- public Greeting greeting (@ RequestParam (value = "name" , defaultValue = "World" ) String name ) {
20- return new Greeting (counter .incrementAndGet (), String . format ( template , name ));
19+ @ GetMapping ("/greeting" )
20+ public Greeting greeting (@ RequestParam (defaultValue = "World" ) String name ) {
21+ return new Greeting (counter .incrementAndGet (), template . formatted ( name ));
2122 }
2223}
Original file line number Diff line number Diff line change 44import org .springframework .boot .test .context .SpringBootTest ;
55
66@ SpringBootTest
7- public class ApplicationTests {
7+ class ApplicationTests {
88
99 @ Test
10- public void contextLoads () {
10+ void contextLoads () {
1111 }
1212
1313}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1414# KIND, either express or implied. See the License for the
1515# specific language governing permissions and limitations
1616# under the License.
17- distributionUrl =https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3 /apache-maven-3.9.3 -bin.zip
17+ distributionUrl =https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.1 /apache-maven-3.9.1 -bin.zip
1818wrapperUrl =https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
Original file line number Diff line number Diff line change 66 <parent >
77 <groupId >org.springframework.boot</groupId >
88 <artifactId >spring-boot-starter-parent</artifactId >
9- <version >2.7.13 </version >
9+ <version >3.1.1 </version >
1010 <relativePath /> <!-- lookup parent from repository -->
1111 </parent >
1212 <groupId >net.javaguides</groupId >
1717 <packaging >war</packaging >
1818
1919 <properties >
20- <java .version>1.8 </java .version>
20+ <java .version>17 </java .version>
2121 </properties >
2222
2323 <dependencies >
2424 <dependency >
2525 <groupId >org.springframework.boot</groupId >
2626 <artifactId >spring-boot-starter-web</artifactId >
2727 </dependency >
28+ <dependency >
29+ <groupId >org.glassfish.jaxb</groupId >
30+ <artifactId >jaxb-runtime</artifactId >
31+ <scope >test</scope >
32+ </dependency >
2833
2934 <dependency >
3035 <groupId >org.springframework.boot</groupId >
3742 </dependency >
3843 <!-- JSTL for JSP -->
3944 <dependency >
40- <groupId >javax.servlet</groupId >
41- <artifactId >jstl</artifactId >
45+ <groupId >javax.servlet.jsp.jstl</groupId >
46+ <artifactId >jstl-api</artifactId >
47+ <version >1.2</version >
4248 </dependency >
4349
4450 <dependency >
4551 <groupId >org.springframework.boot</groupId >
4652 <artifactId >spring-boot-starter-test</artifactId >
4753 <scope >test</scope >
48- <exclusions >
49- <exclusion >
50- <groupId >org.junit.vintage</groupId >
51- <artifactId >junit-vintage-engine</artifactId >
52- </exclusion >
53- </exclusions >
5454 </dependency >
5555 </dependencies >
5656
Original file line number Diff line number Diff line change 99public class HelloController {
1010
1111 @ GetMapping ({"/" , "/hello" })
12- public String hello (@ RequestParam (value = "name" , defaultValue = "World" ,
13- required = true ) String name , Model model ) {
12+ public String hello (@ RequestParam (defaultValue = "World" ,
13+ required = true ) String name , Model model ) {
1414 model .addAttribute ("name" , name );
1515 return "hello" ;
1616 }
You can’t perform that action at this time.
0 commit comments