Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

SpringMVC与Servlet的比较

说是使用Servlet时需要为【用户模块】和【订单模块】分别创建分别创建名为【UserServlet】和【OrderServlet】的Servlet,而使用SpringMVC则可通过【DispatcherController】统一转发请求
image
我的疑问是:使用SpringMVC后确实可以不用再创建两个Servlet了,但不是还得创建两个Controller么?没看出来这里的优势在哪里,望赐教


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

SpringMVC不是为了简单情况下编写代码更简单,而是在复杂需求情况下编写代码更简单。

锤子用起来是简单,如果仅是钉个钉子的话。但造不出复杂的机械。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...