IDEA生成servlet程序

Servlet-IDEA菜单创建servlet程序

1.创建Servlet

IDEA生成servlet程序_第1张图片

2.配置servlet信息

IDEA生成servlet程序_第2张图片

3.配置web.xml

IDEA生成servlet程序_第3张图片

4.根据业务需求更改doPost和doGet方法

package com.sammery.Servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author: SammeryD
 * @Date: Created in 10:48 2020/8/17

 */
public class helloServlet2 extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}

你可能感兴趣的:(servlet,servlet)