JSP与Servlet的关系
有在书很多很多的例子,以及如何使用servlet作为JSP的在互联网上。但我想知道什么是最好的方式去使用它们,用一记好的架构。
There are many, many examples in books, and on the internet about how to use Servlets as JSPs. But I would like to know what the best way to go about using them, with a mind to good architecture.
如果有的Servlet的一对一的关系的JSP?像个ASP.NETcode-背后页面?
Should there be a one-to-one relation of Servlets to JSPs? Acting like ASP.NET "Code-Behind" pages?
还是更喜欢ASP.NET MVC,与单一的Servlet控制多个动作,并将其转发到多个视图?
Or more like ASP.NET MVC, with a single Servlet controlling multiple actions, and forwarding to multiple views?
这是关于纯Java EE开发的问题。请不要简单地认为另一个框架。
This is a question regarding pure Java EE development. Please don't simply suggest another framework.
这个怎么样?我在学校的一个项目做出这样的:
How about this? I made this in one of my school projects:
这是基于我的servlet和JSP的理解我的假设。 我很想有你的意见和想法,以改善这一点。
This was my assumption based on my understanding of servlets and JSP. I would love to have your comments and ideas to improve this.