系统城装机大师 - 固镇县祥瑞电脑科技销售部宣传站!

当前位置:首页 > server > anz > 详细页面

idea配置tomcat过程指南图文详解

时间:2022-04-15来源:www.pcxitongcheng.com作者:电脑系统城

创建项目

勾选Web Application

勾选【JavaEE Application】

名字不是主要的

项目结构:

创建一个测试的【servlet】

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package com.item.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("/GetInfo")
public class GetInfoServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }
  
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("success");
    }
}

项目结构

添加war包

改成根路径

访问完有显示,说明成功。

到此这篇关于idea配置tomcat必坑指南的文章就介绍到这了

分享到:

相关信息

系统教程栏目

栏目热门教程

人气教程排行

站长推荐

热门系统下载