[英]Are servlets the only way to write a Java Web Application
servlet是用Java编写Web应用程序的唯一方法吗?
No. Servlets are just the most convenient way to write a Web application in Java. 不可以.Servlet是用Java编写Web应用程序的最便捷方式。 If you think about it: what is a Web application?
如果你考虑一下:什么是Web应用程序? Quite simply it is an application that can receive an HTTP request and send back an HTTP response.
很简单,它是一个可以接收HTTP请求并发回HTTP响应的应用程序。 Common models for achieving this are:
实现这一目标的常见模型是:
There are variations upon this theme (eg FastCGI for (1)). 这个主题有变化(例如(1)的FastCGI )。 Servlets are an example of (2).
Servlet是(2)的一个例子。 The reason 99% of all Java Web applications and frameworks use servlets is because servlets are standard (they have a specification endorsed by Sun and a reference implementation ) and they're so low-level that pretty much whatever you want can be built on top of them.
99%的Java Web应用程序和框架使用servlet的原因是因为servlet是标准的(它们有Sun认可的规范和参考实现 )而且它们的级别很低,几乎无论你想要什么都可以构建在顶层他们
That servlets are most convenient way to write Web apps in Java is arguable. servlet是用Java编写Web应用程序最方便的方法。 They certainly have been around for a long time, but there are alternatives;
他们肯定已经存在了很长时间,但也有其他选择; take a look at restlets for example: http://www.restlet.org/
看一下restlets,例如: http : //www.restlet.org/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.