Java 小程序与 Servlet
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1723845/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Applet v/s Servlet
提问by Sachin Chourasiya
Whats the difference between Applet and Servlet in JAVA
JAVA中Applet和Servlet的区别
采纳答案by falstro
Applet runs on the client, servlet runs on the server. It's as simple as that.
Applet 运行在客户端,servlet 运行在服务器上。就这么简单。
More specifically, that applet is downloaded to the client, and executes in a JRE inside the browser, and can display whatever it wants to display within the applet frame. The servlet instead runs on the server and (generally) produces a HTML page which is displayed in your browser.
更具体地说,该小程序被下载到客户端,并在浏览器内的 JRE 中执行,并且可以在小程序框架内显示它想要显示的任何内容。servlet 而是在服务器上运行,并且(通常)生成一个 HTML 页面,该页面显示在您的浏览器中。
回答by falstro
A Java Applet is a Java class which is run on the client's JVM (via a Browser Plugin).
Java Applet 是在客户端的 JVM 上运行的 Java 类(通过浏览器插件)。
A Java Servlet is run on the server-side in a Servlet container, like Apache Tomcat and the client recieves the results in the form of plain old HTML.
Java Servlet 在服务器端的 Servlet 容器(如 Apache Tomcat)中运行,客户端以纯旧 HTML 的形式接收结果。
The key difference is that where as one runs on the client side, the other on the Server side.
关键的区别在于,一个在客户端运行,另一个在服务器端运行。
回答by AYUSH GARG
applet is the Desktop application and the Servlet is the web Application
applet 是桌面应用程序,Servlet 是 Web 应用程序
Applet is run on the Clients machine and the Servlet is run the Server Machine And produce the html page on the client browser with the help of the Request And Response Parameter in the Java.servlet.*; Package
Applet 运行在客户端机器上,Servlet 运行在服务器机器上,并借助 Java.servlet.* 中的请求和响应参数在客户端浏览器上生成 html 页面;包裹