Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
This post was edited and submitted for review 2 years ago and failed to reopen the post:
Not suitable for this site
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
要在网络上托管网站,您必须使用套接字。像这样:
在 Java 或 C 中总是相同的方法,我邀请您查看本教程以在 C 中执行此操作:
https://www.binarytides.com/server-client-example -c-sockets-linux/
您还可以阅读以下内容:
https://docs.oracle.com/cd/ E21764_01/core.1111/e10103/intro.htm#ASCON112
如果可以的话完成所有 4 个步骤,然后您将了解中间件如何工作,然后您可以使用 TomCat 等......始终从基础开始。
To host a website on your network, you have to use a socket. Like this:
It's always the same method in Java or C, I invite you to look at this tutorial to do it in C:
https://www.binarytides.com/server-client-example-c-sockets-linux/
You can also read this:
https://docs.oracle.com/cd/E21764_01/core.1111/e10103/intro.htm#ASCON112
If you can do all the 4 steps, then your going to understand how works middleware then you can use TomCat, etc... Always start with the basics.
如果您想使用 Java 提供静态内容、预先编写的 HTML 文件、任何 Web 容器可以使用。 Apache Tomcat 和 Eclipse Jetty 是最简单的两个。
如果您想使用 Java 动态创建内容,请首先了解 Jakarta Servlet(以前称为 Java) Servlet)技术。
许多 Web 容器产品都支持 Servlet。其中包括 Tomcat、Jetty、Glassfish、Payara、WildFly、JBoss、OpenLiberty 等。
从那里,您可能想要利用其他库和框架。此类库和框架的两个最流行的集合是 Jakarta EE 和 Spring。
您不需要实现套接字。 Web 浏览器和 Web 服务器自动处理所有网络。
WebSockets 是另一回事。如果真的对此感兴趣,请参阅 Atmosphere 框架。
If you want to use Java to deliver static content, prewritten HTML files, any of the web containers can be used. Apache Tomcat and Eclipse Jetty are two of the simplest.
If you want to use Java to create content dynamically, start by learning about Jakarta Servlet (formerly Java Servlet) technology.
Many web container products support Servlets. These include Tomcat, Jetty, Glassfish, Payara, WildFly, JBoss, OpenLiberty, and more.
From there, you may want to leverage additional libraries and frameworks. Two of the most popular collections of such libraries and frameworks is Jakarta EE and Spring.
You do not need to implement sockets. The web browser and web server handle all the networking automatically.
WebSockets is something else. If really interested in that, see the Atmosphere framework.