``
首先,看看思维导图,了解顺序。
写一个简单Spring boot web整合
然后跳过第1步,首先加依赖。
写一个简单Spring boot web整合
然后创建Bean类,注意,用了JsonIgnore注解,不输出age。
写一个简单Spring boot web整合
再创建Controller,注意注解用了RestController,用其它组合的注解也可以。
写一个简单Spring boot web整合
开启测试,结果如下,显然,age不返回到JSON里面了。
写一个简单Spring boot web整合
The end

相关文章:

  • 2022-12-23
  • 2021-10-20
  • 2021-08-10
  • 2021-11-10
  • 2022-01-06
  • 2021-06-16
  • 2021-08-01
猜你喜欢
  • 2021-11-19
  • 2021-10-29
  • 2021-12-29
  • 2021-07-25
  • 2021-04-17
  • 2022-03-02
  • 2022-12-23
相关资源
相似解决方案