Tomcat virtual host configuration based on domain name

Using domain name based virtual host configuration is a popular way. You can configure multiple domain names on the same IP and access them through port 80. 1, Suppose the server has an IP address of 192.168.2.170 [root@localhost ~]# ifconfig ens33:5 192.168.2.170/24 up [root@localhost ~]# ifconfig ens33:5: flags=4163 ...

Posted by karlovac on Tue, 05 May 2020 01:55:34 -0700

A simple jsp interface to upload attachments to the server instance

1. Description: upload the attachment in a web project. The jar package used in demo is commons-fileupload-1.3.3.jar commons-httpclient-3.1.jar commons-io-2.0.1.jar. It can be obtained in the source code. Download address: http://download.csdn.net/download/shenju 2011/10215828 2. Code interpretation (1) The jsp interface is processed with a ...

Posted by hairyjim on Tue, 05 May 2020 01:30:35 -0700

Go Language (18) context & Log Items

Context&log items context Method to cancel goroutine in general scenarios var wg sync.WaitGroup var exit bool func worker(exitChan chan struct{}) { LOOP: for { fmt.Printf("work\n") time.Sleep(time.Second) /*if exit { break } */ select { case <- exitChan: break LOOP ...

Posted by loopykd on Mon, 04 May 2020 16:40:51 -0700

ssm upload image file to ftp (image compression processing)

ssm upload image file to ftp (image compression processing) Development tool Eclipse 1. Introduce jar package Download address of jar package: Ali central warehouse 2. Configure spring-mvc.xml and add the following code <bean id="multipartResolver" class="org.springframework.web.multipart.common ...

Posted by asy1mpo on Mon, 04 May 2020 04:28:17 -0700

Java WEB -- file upload

The recently learned file upload in the web phase, I just want to record it, help myself review and help you learn. Generally, I will save the uploaded file under the web inf in the server, because the user will not directly access it, and the path we save to the database is generally the path. There is no demonstration of database upload path. ...

Posted by notionlogic on Mon, 04 May 2020 03:50:44 -0700

A tutorial of using JAX-RS client WebClient

JAX-RS client programming – > There are two ways: ① Using the http client tool, we need to customize and parse the HTTP protocol ② This article focuses on the use of WebClient tool class (Brought by CXF) to explain RS client programming. Using RS WebClient requires importing coordinates in pom.xml file & ...

Posted by vineld on Sun, 03 May 2020 21:16:32 -0700

File upload learning record used in Java Web project (1)

File upload learning record used in Java Web project (1) Introduction: File upload is a commonly used function in development. I will mainly introduce the implementation of basic file upload function with commons-fileupload-1.2.1.jar package, that is, file upload to the specified directory, and introduce the relevant classes and methods use ...

Posted by hypuk on Sun, 03 May 2020 02:26:04 -0700

36. Spring boot configures Cors to solve cross domain requests

CORS (cross origin resource sharing) "cross domain resource sharing" is a W3C standard. It allows browsers to send Ajax requests to cross domain servers, breaking the resource limit that Ajax can only access the site. CORS is used in many places. JS payment of wechat payment is to send cross domain requests to wechat servers through ...

Posted by insane on Sat, 02 May 2020 19:32:13 -0700

The case of network programming based on HttpClient Download Text and picture download text and picture for Android

The case of downloading text and picture network programming based on HttpClient for Android 1, Operation effect 2, Implementation steps 1. Create android app DownloadTextImageByHttpClient 2, Main layout file activity main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://s ...

Posted by prasitc2005 on Sat, 02 May 2020 19:28:17 -0700

Eight of three phases of Linux: Architecture nginx practical application

8, Architecture nginx practical application (1) Introduction of web service software There are three kinds of software commonly used to provide static Web services: 1 Apache: This is the mainstream of small and medium-sized Web services, the big brother of web servers. 2 Nginx: The mainstream of Web services for large-scale websites, onc ...

Posted by cdinca on Sat, 02 May 2020 14:52:31 -0700