Foreword
This article is a handwritten personal blog site two: The first eclipse of the web project
No public
Eclipse, Tomcat configuration
Windows--->Preferences--->Server---->Runtime Environments
Add ----> Select your download version of Tomcat
I downloaded the Tomcat version is 8.5, and check the Create a new local server
Click Browse, select your Tomcat directory, then Finish
After a successful listing will appear a Tomcat server, click Apply and Close
A project view appears Servers
Ctrl + N fast new projects, search dyna, select Dynamic Web Project ---> Next
Fill in the project name and project path
Next click Add Folder to add a folder named lib then, will be stored for future third-party libraries
After continued Next, be sure to check Generate web.xml, and Finish
After the success of the project will see the view we have new projects MyBlog
Right-click the WebContent directory ---> New ---> JSP File
Repeat named index.jsp ---> Finish
Open index.jsp might find these two lines reported red, you can delete
The first to write about the test code
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的个人博客</title>
</head>
<body>
<div>
<header>
<h1>我的个人博客</h1>
</header>
</div>
</body>
</html>
Right-click the project name ---> Run as ---> Run on Server, which means running on another server, you can direct shortcuts
Direct Finish
At this eclipse will open the built-in browser, the following effect can also copy the address into your browser.
The default port number is 8080, if you do not like or 8080 port is in use by another program, you can modify here
For example, modify the restart after 80 Tomcat
At this point no longer have access to 8080 will respond only to 80 or remove the port number, because 80 is the default http protocol