Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 MVC 框架中,假设哪一层将数据格式化/转换为 JSON。应该在Web层还是在Service层完成?在我看来,它应该在 Web 层(Spring 控制器)中完成,但有些人建议在服务层中这样做。其他人对此有何看法?
是的你是对的。
我也认为 JSON 操作应该在 Web 层完成,这样做会让你的代码更易于管理。