Handwritten personal blog (b)

Foreword

This article is a handwritten personal blog site two: The first eclipse of the web project

No public

image.png

Eclipse, Tomcat configuration

Windows--->Preferences--->Server---->Runtime Environments

image.png

image.png

Add ----> Select your download version of Tomcat

image.png

I downloaded the Tomcat version is 8.5, and check the Create a new local server

image.png

Click Browse, select your Tomcat directory, then Finish

image.png

After a successful listing will appear a Tomcat server, click Apply and Close

image.png

A project view appears Servers

image.png

Ctrl + N fast new projects, search dyna, select Dynamic Web Project ---> Next

image.png

Fill in the project name and project path

image.png

Next click Add Folder to add a folder named lib then, will be stored for future third-party libraries

image.png

After continued Next, be sure to check Generate web.xml, and Finish

image.png

After the success of the project will see the view we have new projects MyBlog

image.png

Right-click the WebContent directory ---> New ---> JSP File

image.png

Repeat named index.jsp ---> Finish

image.png

Open index.jsp might find these two lines reported red, you can delete

image.png

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

image.png

Direct Finish

image.png

At this eclipse will open the built-in browser, the following effect can also copy the address into your browser.

image.png

image.png

The default port number is 8080, if you do not like or 8080 port is in use by another program, you can modify here

image.png

For example, modify the restart after 80 Tomcat

image.png

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

image.png

Guess you like

Origin www.cnblogs.com/HouXinLin/p/11621642.html