You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ni...@apache.org on 2017/12/22 03:16:05 UTC
[incubator-servicecomb-java-chassis] 09/11: JAV-548 change demo
springmvc-server, one input parameter changed from MultipartFile to Part
This is an automated email from the ASF dual-hosted git repository.
ningjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git
commit e7382511801230d1facaa8068f5aa98f49bd85d5
Author: wujimin <wu...@huawei.com>
AuthorDate: Thu Dec 14 08:42:49 2017 +0800
JAV-548 change demo springmvc-server, one input parameter changed from MultipartFile to Part
---
.../io/servicecomb/demo/springmvc/server/CodeFirstSpringmvc.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/demo/demo-springmvc/springmvc-server/src/main/java/io/servicecomb/demo/springmvc/server/CodeFirstSpringmvc.java b/demo/demo-springmvc/springmvc-server/src/main/java/io/servicecomb/demo/springmvc/server/CodeFirstSpringmvc.java
index 3fc76aa..ff17d29 100644
--- a/demo/demo-springmvc/springmvc-server/src/main/java/io/servicecomb/demo/springmvc/server/CodeFirstSpringmvc.java
+++ b/demo/demo-springmvc/springmvc-server/src/main/java/io/servicecomb/demo/springmvc/server/CodeFirstSpringmvc.java
@@ -24,6 +24,7 @@ import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.Part;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response.Status;
@@ -73,7 +74,7 @@ import io.vertx.core.json.JsonObject;
@RestSchema(schemaId = "codeFirst")
@RequestMapping(path = "/codeFirstSpringmvc", produces = MediaType.APPLICATION_JSON_VALUE)
public class CodeFirstSpringmvc {
- private String _fileUpload(MultipartFile file1, MultipartFile file2) {
+ private String _fileUpload(MultipartFile file1, Part file2) {
try (InputStream is1 = file1.getInputStream(); InputStream is2 = file2.getInputStream()) {
String content1 = IOUtils.toString(is1);
String content2 = IOUtils.toString(is2);
@@ -85,7 +86,7 @@ public class CodeFirstSpringmvc {
@PostMapping(path = "/upload", produces = MediaType.TEXT_PLAIN_VALUE)
public String fileUpload(@RequestPart(name = "file1") MultipartFile file1,
- @RequestPart(name = "someFile") MultipartFile file2) {
+ @RequestPart(name = "someFile") Part file2) {
return _fileUpload(file1, file2);
}
--
To stop receiving notification emails like this one, please contact
"commits@servicecomb.apache.org" <co...@servicecomb.apache.org>.