Build local Tomcat server and related configurations for Android
In Android, we often deal with servers. In order to facilitate code testing, we need to build a local server. In fact, building a local Tomcat server is also very simple:
1、 Tomcat Download
Download from Tomcat's official website http://tomcat.apache.org/ , tomcat7 is downloaded here. Download it locally and unzip it.
2、 Tomcat configuration
Before configuring tomcat, you should configure the Java running environment. Configure computer environment variables, advanced settings.
1. New variable name: Catalina_ Base, variable value: D: \ apache-tomcat-7.0.73
2. New variable name: Catalina_ Home, variable value: D: \ apache-tomcat-7.0.73
3. Open path and add variable value: D: \ apache-tomcat-7.0.73 \ bin; D:\apache-tomcat-7.0.73\lib
The Tomcat environment is configured. Start and verify. Open CMD and enter startup. Another CMD window of Tomcat startup information will pop up. Open the browser and enter: http://localhost:8080/ , the kitten interface appears, indicating that it has been configured.
3、 Eclipse new web project
Open eclipse and pay attention to installing the Java EE plug-in. Right click New - > other - > Web - > dynamic web project, enter the project name, click the new runtime button, and select Tomcat 7 of apace.
Next - > specify the path of tomcat,
After finishing, our project will be created and a new servlet will be created as helloservlet. In the doget method
run as->run on server->finish。 The server starts and the browser enters http://localhost:8080/HelloWeb/HelloServlet , as shown in the figure
At this point, the Tomcat server is set up. Isn't it very simple!
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.