一、如何安装TomCat
1.1安装包下载地址:https://tomcat.apache.org/download-70.cgi
1.2 安装exe文件,下一步直到安装成功。并启动Tomcat服务
1.3 访问 http://localhost:8080/ 效果图如下:
二、新建Web开发项目。
2.1 新建【File——New——Dynamic Web Project】
2.2 在Web项目Web-INF 路径下新建Index.jsp
2.3 修改index.jsp的编码,修改为UTF-8
<%@ 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>Insert title here</title>
</head>
<body>
Web开发项目——WeCat
</body>
</html>
2.4 运行服务
选择Index.jsp 点击右键,Run On Server, 运行成功后,访问效果如下:
第一个Web项目运行成功。