丙午🐎年

acc8226 的博客

您可以重定义或重载 C# 中内置的运算符。因此,程序员也可以使用用户自定义类型的运算符。重载运算符是具有特殊名称的函数,是通过关键字 operator 后跟运算符的符号来定义的。与其他函数一样,重载运算符有返回类型和参数列表。

例如,请看下面的函数

1
2
3
4
5
6
7
public static Box operator+ (Box b, Box c) {
Box box = new Box();
box.length = b.length + c.length;
box.breadth = b.breadth + c.breadth;
box.height = b.height + c.height;
return box;
}
阅读全文 »

Apache 是世界使用排名第一的 Web 服务器软件。它可以运行在几乎所有广泛使用的计算机平台上,由于其跨平台和安全性被广泛使用,是最流行的 Web 服务器端软件之一。

1. 执行如下命令,安装 Apache 服务及其扩展包。

1
yum -y install httpd httpd-manual mod_ssl mod_perl mod_auth_mysql

2. 执行如下命令,启动 Apache 服务。

1
systemctl start httpd.service

3. 测试 Apache 服务是否安装并启动成功。

Apache 默认监听 80 端口,所以只需在浏览器访问即可。

阅读全文 »

Jetty 提供了一个 web 服务器和 servlet 容器,另外还提供了对 HTTP/2、 WebSocket、 OSGi、 JMX、 JNDI、 JAAS 和许多其他集成的支持。这些组件是开放源码的,可以免费用于商业用途和分发。

在开发和生产中,Jetty 被广泛应用于各种项目和产品中。Jetty 长期以来深受开发人员的喜爱,因为它可以轻松地嵌入到设备、工具、框架、应用服务器和现代云服务中。

下载地址 https://www.eclipse.org/jetty/download.html

参考文档 Jetty : The Definitive Reference (eclipse.org)

启动和关闭服务脚本

1
2
service jetty start
service jetty stop
阅读全文 »

  • web 服务器, 轻量级, 能处理大并发量
  • 反向代理服务器(负载均衡)

你可以轻松的在服务器上通过 Nginx 部署 HTTP 静态服务。

安装

windows 下 Nginx 环境的安装

下载压缩包后进行解压,双击里面的 nginx.exe 即可运行

linux 下 Nginx 环境的安装

CentOS 下 yum 安装
使用 yum 来安装 Nginx
yum install nginx -y

阅读全文 »

tomcat 版本的选择

Apache Tomcat 是 Jakarta EE (正式的 Java EE)技术的一个子集的开放源码软件实现。Apache Tomcat 的不同版本可用于规范的不同版本。规范和相应的 Apache Tomcat 版本之间的映射如下:

Servlet Spec JSP Spec EL Spec WebSocket Spec Authentication (JASPIC) Spec Apache Tomcat Version Latest Released Version Supported Java Versions
6.0 3.1 5.0 2.1 3.0 10.1.x 10.1.0-M16 (beta) 11 and later
5.0 3.0 4.0 2.0 2.0 10.0.x 10.0.22 8 and later
4.0 2.3 3.0 1.1 1.1 9.0.x 9.0.64 8 and later
3.1 2.3 3.0 1.1 1.1 8.5.x 8.5.81 7 and later
3.1 2.3 3.0 1.1 N/A 8.0.x (superseded) 8.0.53 (superseded) 7 and later
3.0 2.2 2.2 1.1 N/A 7.0.x (archived) 7.0.109 (archived) 6 and later (7 and later for WebSocket)
2.5 2.1 2.1 N/A N/A 6.0.x (archived) 6.0.53 (archived) 5 and later
2.4 2.0 N/A N/A N/A 5.5.x (archived) 5.5.36 (archived) 1.4 and later
2.3 1.2 N/A N/A N/A 4.1.x (archived) 4.1.40 (archived) 1.3 and later
2.2 1.1 N/A N/A N/A 3.3.x (archived) 3.3.2 (archived) 1.1 and later
阅读全文 »
0%