request.getServerName() 可以返回当前页面所在的服务器的名字,localhost
访问路径:http://localhost:8080/demo/
返回:localhost
访问路径:http://127.0.0.1:8080/demo/
返回:127.0.0.1
request.getServerName()
最新推荐文章于 2024-06-20 11:50:09 发布
request.getServerName() 可以返回当前页面所在的服务器的名字,localhost
访问路径:http://localhost:8080/demo/
返回:localhost
访问路径:http://127.0.0.1:8080/demo/
返回:127.0.0.1