Skip to content

Commit

Permalink
修改RequestMapping参数
Browse files Browse the repository at this point in the history
  • Loading branch information
sunjun-qima committed Sep 27, 2016
1 parent a024271 commit a768ae7
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public FileUploadController(StorageService storageService) {
}

//file list
@GetMapping
// @GetMapping
@RequestMapping(method = RequestMethod.GET)
public String listUploadedFiles(Model model) throws IOException {

model.addAttribute("active_fileUpload", true);
Expand All @@ -47,7 +48,8 @@ public String listUploadedFiles(Model model) throws IOException {
}

//download file
@GetMapping("/files/{filename:.+}")
// @GetMapping("/files/{filename:.+}")
@RequestMapping(value = "/files/{filename:.+}", method = RequestMethod.GET)
@ResponseBody
public ResponseEntity<Resource> serveFile(@PathVariable String filename) {

Expand All @@ -59,7 +61,8 @@ public ResponseEntity<Resource> serveFile(@PathVariable String filename) {
}

//upload file
@PostMapping
// @PostMapping
@RequestMapping(method = RequestMethod.POST)
public String handleFileUpload(@RequestParam("file") MultipartFile file,
RedirectAttributes redirectAttributes) {

Expand Down

0 comments on commit a768ae7

Please sign in to comment.