我有一些非常奇怪的问题.我想调用被调用的方法create但不幸的是服务器抛出错误,但我不知道为什么.这是我的示例REST控制器
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import pl.toby.model.User;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@RestController
@RequestMapping("/index")
public class HelloController {
private List<User> users;
public HelloController() {
users = Arrays.asList(
new User(1, "Jan", "Kowalski"),
new User(2, "Anna", "Nowak"),
new User(3, "Andrzej", "Przybylski"),
new User(4, "Maciej", "Adamczyk"),
new User(5, "Jacek", "Król")
);
}
// here is method, that I can create user
// i call it with /index/create request URI
@RequestMapping(value = "/create", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public List<User> …Run Code Online (Sandbox Code Playgroud) 我想知道,如何解决一个问题。
好的。我有两个场景。我想将不可调整大小设置为第一个场景,但第二个场景仍然可以调整大小。我不知道该怎么做。
你有什么主意吗?
谢谢你的帮助。