JSP与Servlet的关系 [英] JSP to Servlet Relation

查看:129
本文介绍了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.

这篇关于JSP与Servlet的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆