简体   繁体   English

我是否需要在本地计算机上安装 Java 才能运行使用 JSP 页面的网站?

[英]Do I need to have Java installed on my local machine to run a website that uses JSP pages?

This is probably a stupid question but I know nothing about Java.这可能是一个愚蠢的问题,但我对 Java 一无所知。 Did a quick google and found nothing...做了一个快速的谷歌并没有发现任何东西......

If "running a website" means serving it, then yes.如果“运行网站”意味着服务它,那么是的。 If it means viewing the website, then no (unless it contains Java applets, but that's orthogonal to your question).如果这意味着查看该网站,那么没有(除非它包含 Java 小程序,但这与您的问题正交)。

It's not necessary, JSP is a server side technology that generally speaking responds to http requests with html (or images/css/javascript).没必要,JSP 是一种服务器端技术,一般来说用 html(或 images/css/javascript)响应 http 请求。

As long as you have a client in your machine that can send http requests and read the responses ( a web browser for example), you can perfectly use a JSP application.只要您的机器中有一个客户端可以发送 http 请求并读取响应(例如 web 浏览器),您就可以完美地使用 JSP 应用程序。

The only case when you will need to have java runtime in your local machine, is if you are connecting to a page that includes an applet, java web start o javafx app. The only case when you will need to have java runtime in your local machine, is if you are connecting to a page that includes an applet, java web start o javafx app.

Maybe you should comment if you are intending to SERVE the website from your local machine, or just connect from your local machine to a website in another server如果您打算从本地计算机上服务该网站,或者只是从本地计算机连接到另一台服务器中的网站,也许您应该发表评论

  • To just visit the site on your machine does not require a JVM installed on your machine只需在您的机器上访问该站点不需要在您的机器上安装 JVM
  • If you are running a server on your machine (which is serving the webpages) then you need JVM installed on your machine, and JDK to actually develop a JSP website project for compilation purpose.如果您在您的机器上运行服务器(为网页提供服务),那么您需要在您的机器上安装 JVM 和 JDK 来实际开发 JSP 网站项目以进行编译。

If the website only uses JSP (no webstart, no applets) then you do not need java since no java code is run on your machine.如果网站只使用 JSP(没有 webstart,没有小程序),那么您不需要 java,因为您的机器上没有运行 java 代码。

Yes, if you want to run locally a website that uses JSP pages, you'll need at least Java plus a servlet container: typically Tomcat or Jetty.是的,如果你想在本地运行一个使用 JSP 页面的网站,你至少需要 Java 和一个 servlet 容器:通常是 Tomcat 或 Jetty。

Every jsp page is "compiled" into a.java file which then is compiled using the javac compiler into.class and then finally executed by the application server.每个 jsp 页面都被“编译”成一个.java 文件,然后使用 javac 编译器将其编译成.class,最后由应用服务器执行。 So yes, you do not Java installed to run JSP -- and more specifically you will need JDK not just the JRE!所以是的,你不需要安装 Java 来运行 JSP——更具体地说,你需要 JDK 而不仅仅是 JRE!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我的网站建立在Java Server Pages(JSP)之上-我仍可以使用Joomla吗? - My website is built on Java Server Pages (JSP) - can I use Joomla still? 我的 Mac 上安装了多少个 Java 版本? - How many java versions do i have installed on my Mac? 显示我的网站时如何检测用户喜欢的语言,网站基于Java jsp - How do I detect user preferred language when showing my website , website is java jsp based 如何在我的机器上同时安装多个版本的 Java JDK? - How can I have multiple versions of the Java JDK installed on my machine at the same time? 要在Mac上的Eclipse上使用.jsp页面,我必须在哪里放置.java或.class文件? - To use .jsp pages with Eclipse on Mac, Where do I have to put .java or .class files? 如果已经安装了JDK和JRE,是否需要为Eclipse Neon安装Java插件? - Do I need to install Java plugins for Eclipse Neon if I already have JDK and JRE installed? 我可以在机器上同时安装Maven和Gradle吗 - Can I have both Maven and Gradle installed on my machine 安装了码头服务器。 我是否需要其他配置才能运行php / java代码? - installed a jetty server. Do I need other configurations for it to run php/java code? 我是否需要Web服务器才能使机器对Java RMI进行机器处理? - Do I need a web server for machine to machine Java RMI? Java Applet不在我的本地计算机上运行 - Java applet doesn't run on my local machine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM