+
95
-

spring boot如何返回json数据?

spring boot如何返回json数据?


网友回复

+
15
-

将controller的注解改成@RestController,示例

import com.example.demo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation....

点击查看剩余70%

我知道答案,我要回答