Eclipse JSP / Servlet environment to build
This article assumes that you have installed the JDK environment. .
We can use Eclipse to build a JSP development environment. First we download the packages separately:
Tomcat download and install
You can download the corresponding package according to your system (the following is the Window system):
After downloading, extract the zip file to the D drive (you can choose it yourself):
Note that directory names cannot have Chinese and spaces. The directory is as follows:
- bin: Binary executable file. The most commonly used file is startup.bat, if it is a Linux or Mac system startup file is startup.sh.
- conf: Configuration directory. The core file inside is server.xml. You can change the port number and so on. The default port number is 8080, which means that this port number cannot be used by other applications.
- lib: library file. The directory where the jar package needed for tomcat runtime is located
- temp: Temporarily generated file, ie cache
- webapps: web app. Web applications placed in this directory can be accessed directly by the browser
- work: The compiled class file.
We will test it now on the browser:
test.jsp file code is as follows:
<%@ page contentType="text/html;charset=UTF-8" %> <% out.print("eclipse : http://www.welookups.com"); %>
Associating Tomcat with Eclipse
After Eclipse J2EE is downloaded, unzip it and use it. Let's open Java.EE ，Select menu bar Windows-->preferences（Mac System is Eclipse-->Preferences), the following interface pops up: