In the process of configuring the Java EE development environment encountered a lot of problems, in this system to tidy up my previous configuration process
Note: The configuration process is learned from the Jsp&servlet study notes (second Edition) detailed process can read this book. All my development tools will be posted at the end of the article
first, prepare the development environment
1. Install Tomcat
Here, Apache Tomcat is used as a Web container for download URLs:
http://tomcat.apache.org/download-70.cgi
Note: The servlet/jsp version used here is Servlet 3.0/jsp 2.2, and the Tomcat version that supports this version is Tomcat 7.x or more
The downloaded tomcat comes with a simple HTTP server that, compared to a real HTTP server, is too simple for the HTTP server that comes with Tomcat, for development purposes only and is not recommended for future direct online service
2. Install Eclipse
Then prepare the IDE, which uses eclipse (recommended version 3.6 above) to download the URL:
http://www.eclipse.org/downloads/
3. Installing the JDK
The version used here is Java SE 7, download URL:
Http://www.oracle.com/technetwork/java/javase/downloads/index.html
4. Configuring the Web container for Tomcat in eclipse
This is where both Eclipse and Tomcat are decompressed in D:\workspace.
Perform the following steps
(1) running eclipse in the Eclipse directory
(2) When the Workspace Launcher dialog box appears, the workspace: set to D:\workspace, stand-alone OK
(3) Select window| Preferences command, in the Preferences dialog box, expand the Server node and select the Runtime Environment node
(4) The Add button in the right server runtime environments, and then the new Server Runtime Environment dialog box, select Apache Tomcat v7.0, stand-alone next
(5) The browse button next to the stand-alone Tomcat installation directory, select the extracted Tomcat directory in the D:\workspace, single machine determines
(6) Single-machine finish after the complete configuration of the machine OK
5. Configure the text encoding for workspace presets
UTF-8 is the most widely used Unicode implementation on the Internet, and it is recommended that the relevant encoding be set to UTF-8
(1) Select window| Prefences command, in the Preferences dialog box, expand the workspace node
(2) Select other in the text file encoding on the right and select UTF-8 in the drop-down list
(3) Expand the Web node to the left, select CSS Files, and select UTF-8 on the right encoding
(4) Select HTML Files and select UTF-8 on the right encoding
(5) OK for Stand-alone Preferences dialog box
Second, the first servlet program
1. IDE uses projects to manage application-related resources
(1) Select file| new| Dynamic Web Project command, the new Dynamic Web Project dialog box appears, enter Firstservlet in the Project Name text box
(2) Determine the target runtime for the Apache Tomcat v7.0 that was just set up, stand-alone finish
(3) Expand the Java Resources node in the new project, right-click on src and select new| servlet command
(4) Pop Up the Create Servlet dialog box, enter Com.test in the Java Package text box, enter HelloServlet in the Class name text box, stand-alone next
(5) Select the HelloServlet in the URL mappings, the Edit button on the right of the machine, change the pattern to/hello.view after the stand-alone OK button
(6) Finish in the single-Machine Create servlet dialog box
Note: After Servlet 3.0, you can use annotations (Annotation) to tell the container which servlets provide the service and additional information that the previous version must use the Web. xml file to define the servlet
2. Run the servlet
(1) Right click on Helloservlet.java, select Run as| Run on Server
(2) in the Run on Server dialog box that pops up, determine that the server runtime environment is the Apache Tomcat v7.0 that was previously set, and the standalone finish
(3) After Tomcat is launched, the browser with eclipse will appear
Note: The related classes of the Servlet API and JSP API are typically encapsulated in Servlet-api.jar, Jsp-api.jar, in the Tomcat subdirectory below, and eclipse will automatically complete the path setting, expand Project Libraries/apache Tomcat v7.0 node in Explorer, you can see the CLASSPATH setting for the associated jar file
Third, jar file import eclipse
1. Jstl related download and API file description
Download URL:
Http://www.oracle.com/technetwork/java/index-jsp-135995.html
2. Deployment assembly settings using JAR file
(1) on the created project, right-click to select the Properties command and select Deployment Assembly on the Project Properties dialog box that appears
(2) Stand-alone Add button, select Archives from File system in the New Assembly directive dialog box next
(3) Stand-alone Add button, select the source of the jar file, single finish
(4) OK in stand-alone web Deployment assembly
(5) In the Java resources/libraries node of the project, you can find that the jar file has been set under the Web APP libraries
Note: After a successful file deployment, you can find that the jar file has been set in the/web-inf/lib directory under Project Tomcat
Related development tools
-Jdk7:jdk-7windows-x64_20140115.zip
Https://pan.baidu.com/s/1bo4vHvx
-Eclipse IDE:Eclipseforjavaee64bit.zip
Https://pan.baidu.com/s/1c2kXcn2
-Apache:apache-tomcat-7.0.52-windows-x64.zip
Https://pan.baidu.com/s/1o8HMG2m
-Mysql:mysql-5.1.63-winx64.zip
Https://pan.baidu.com/s/1hsgLidQ
-Sqlyog:sqlyog-11.2.5-0.x64.rar
Https://pan.baidu.com/s/1qXN7YFE
-MySQL driver: mysql-connector-java-5.1.16.zip
Https://pan.baidu.com/s/1dFzNywT
-JAVABEANS (tm) ACTIVATION Framework:jaf-1_1_1.zip
Https://pan.baidu.com/s/1dFqZT8P
-Java Mail:javamail1_4_4.zip
Https://pan.baidu.com/s/1mic87xA
-Jstl:jstl 1.1.zip
Https://pan.baidu.com/s/1nu90mDz
-apache Commons Lang:commons-lang.jar
Https://pan.baidu.com/s/1cxlEs2
Java Help document Chinese version
Https://pan.baidu.com/s/1boKAChx
Java EE Development Tools and environment configuration process