-
Notifications
You must be signed in to change notification settings - Fork 28
/
FooController.java
42 lines (33 loc) · 1.21 KB
/
FooController.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package me.chanjar.controllers;
import me.chanjar.exception.SomeException;
import org.springframework.stereotype.Controller;
import org.springframework.util.MimeTypeUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.View;
@Controller
public class FooController {
@RequestMapping("/return-model-and-view")
public ModelAndView returnModelAndView() throws SomeException {
throw new SomeException();
}
@RequestMapping("/return-view-name")
public String returnViewName() throws SomeException {
throw new SomeException();
}
@RequestMapping("/return-view")
public View returnView() throws SomeException {
throw new SomeException();
}
@RequestMapping(value = "/return-text-plain", produces = MimeTypeUtils.TEXT_PLAIN_VALUE)
@ResponseBody
public String returnPlainText() throws SomeException {
throw new SomeException();
}
@RequestMapping(value = "/return-json-1", produces = MimeTypeUtils.APPLICATION_JSON_VALUE)
@ResponseBody
public String returnJson1() throws SomeException {
throw new SomeException();
}
}