[英]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如果您打算从本地计算机上服务该网站,或者只是从本地计算机连接到另一台服务器中的网站,也许您应该发表评论
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.