Java index.html 和 index.jsp 有什么区别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23299237/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 21:44:58  来源:igfitidea点击:

What is difference index.html vs index.jsp?

javahtmljspdifference

提问by user2387220

One URL ends in 'index.html'. Another URL ends in 'index.jsp'. Explain how these two requests result in very different behavior by the server.

一个 URL 以“index.html”结尾。另一个 URL 以“index.jsp”结尾。解释这两个请求如何导致服务器的行为截然不同。

采纳答案by victorf

JSP is a file extension for Java Server Pages file format. A JSP is an HTML page containing a reference to Java servlets, or, java server side applets.

JSP 是 Java Server Pages 文件格式的文件扩展名。JSP 是一个 HTML 页面,其中包含对 Java servlet 或 Java 服务器端小程序的引用。

JSP files help to deliver server side customized content on a webpage through servlets. JSP files keep the Java code secret because it runs server side.

JSP 文件有助于通过 servlet 在网页上提供服务器端定制内容。JSP 文件将 Java 代码保密,因为它在服务器端运行。

index.htmlis the default page for that directory. On most Web servers, the default page in a directory is named "index.html". So, index.jsp would be the a default Java Server Page in a directory.

index.html是该目录的默认页面。在大多数 Web 服务器上,目录中的默认页面被命名为“index.html”。因此,index.jsp 将是目录中的默认 Java Server Page。