Migrated modules using parent-spring-5:

ethereum
persistence-modules/spring-data-elasticsearch
persistence-modules/spring-data-mongodb
spring-dispatcher-servlet
spring-mvc-forms-jsp
spring-mvc-java
This commit is contained in:
geroza
2019-01-09 12:23:10 -02:00
parent 39bfa04d11
commit 1ca15e5919
43 changed files with 366 additions and 52 deletions

View File

@@ -11,7 +11,6 @@ The "REST With Spring" Classes: http://bit.ly/restwithspring
- [Introduction to Advice Types in Spring](http://www.baeldung.com/spring-aop-advice-tutorial)
- [A Guide to the ViewResolver in Spring MVC](http://www.baeldung.com/spring-mvc-view-resolver-tutorial)
- [Integration Testing in Spring](http://www.baeldung.com/integration-testing-in-spring)
- [Spring JSON-P with Jackson](http://www.baeldung.com/spring-jackson-jsonp)
- [A Quick Guide to Spring MVC Matrix Variables](http://www.baeldung.com/spring-mvc-matrix-variables)
- [Intro to WebSockets with Spring](http://www.baeldung.com/websockets-spring)
- [File Upload with Spring MVC](http://www.baeldung.com/spring-file-upload)

View File

@@ -8,10 +8,10 @@
<packaging>war</packaging>
<parent>
<artifactId>parent-spring-5-1</artifactId>
<artifactId>parent-spring-5</artifactId>
<groupId>com.baeldung</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../parent-spring-5-1</relativePath>
<relativePath>../parent-spring-5</relativePath>
</parent>
<dependencies>
@@ -60,6 +60,12 @@
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons-fileupload.version}</version>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
@@ -70,8 +76,17 @@
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<!-- Thymeleaf -->
<dependency>
@@ -255,6 +270,7 @@
<guava.version>19.0</guava.version>
<commons-lang3.version>3.5</commons-lang3.version>
<commons-fileupload.version>1.3.2</commons-fileupload.version>
<commons-io.version>2.5</commons-io.version>
<jsonpath.version>2.2.0</jsonpath.version>
<!-- testing -->

View File

@@ -60,17 +60,4 @@ public class CompanyController {
result.put("name", name);
return new ResponseEntity<>(result, HttpStatus.OK);
}
@RequestMapping(value = "/companyResponseBody", produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public Company getCompanyResponseBody() {
final Company company = new Company(2, "ABC");
return company;
}
@RequestMapping(value = "/companyResponseEntity", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Company> getCompanyResponseEntity() {
final Company company = new Company(3, "123");
return new ResponseEntity<Company>(company, HttpStatus.OK);
}
}

View File

@@ -1,13 +0,0 @@
package com.baeldung.web.controller.advice;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.AbstractJsonpResponseBodyAdvice;
@ControllerAdvice
public class JsonpControllerAdvice extends AbstractJsonpResponseBodyAdvice {
public JsonpControllerAdvice() {
super("callback");
}
}

View File

@@ -1,15 +1,10 @@
package com.baeldung.config;
import com.baeldung.web.controller.handlermapping.BeanNameHandlerMappingController;
import com.baeldung.web.controller.handlermapping.SimpleUrlMappingController;
import com.baeldung.web.controller.handlermapping.WelcomeController;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping;
import org.springframework.web.servlet.handler.SimpleUrlHandlerMapping;
import java.util.HashMap;
import java.util.Map;
import com.baeldung.web.controller.handlermapping.BeanNameHandlerMappingController;
import com.baeldung.web.controller.handlermapping.WelcomeController;
@Configuration

View File

@@ -9,7 +9,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.spring4.view.ThymeleafViewResolver;
import org.thymeleaf.templateresolver.ServletContextTemplateResolver;

View File

@@ -1,6 +1,5 @@
package com.baeldung.web.controller;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.model;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

View File

@@ -20,7 +20,6 @@ import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import com.baeldung.spring.web.config.WebConfig;
import com.baeldung.spring.web.config.WebConfig;
@RunWith(SpringJUnit4ClassRunner.class)