Tomcat--容器(Container)
下载
下载完成

请求/响应

结构

测试
查看Jdk版本

改端口号localhost8080-->8099

学学人家以后牛逼了可以用自己名字当文件夹名

配置端口8099
找到server文件

用记事本打开

再打开另一个logging文件

"乱码解决"步骤:UTF-8改成windows的编码格式GBK。
还是用记事本打开

汇总所有要改的地方:

测试乱码问题是否解决

ctrl+c关闭此窗口
log日志

错误解决
JVM Bind: 1.重启电脑。 2.linux命令

idea中配置tomcat
建议不要和博主一样,文件夹用中文命名

检查

创建项目

注意红框改成Web否则创建的项目没有web文件夹。

可以改下结构,将来在ee.包下写代码

next

等一会

没配好在这里修改
Run

搭建javaEE架构

第一个JavaEE程序

接受亲后端代码
java
package com.ffyc.servlet;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet(value = "/test")
public class HelloServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
System.out.println("GET......");
}
//Post不动
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
super.doPost(req, resp);
System.out.println("Post");
}
}

index.jsp 默认前端页面

什么是servlet
serv er + applet = servlet
可以解释为:能跑的java程序。
GET
- 地址栏输入
- a标签
POST
form表单

页面
用户名密码不安全
GET------直接显示

改回post------隐藏了表单内容

登录项目
创建顺序小结
pre

项目

开写
