实现 Servlet 接口
package top.simba1949.servlet;
import javax.servlet.*;
import java.io.IOException;
/**
-
@author SIMBA1949
-
@date 2019/6/6 22:35
*/
public class ServletImpl implements Servlet {
@Override
public void init(ServletConfig servletConfig) throws ServletException {
System.out.println(“初始化方法”);
}@Override
public ServletConfig getServletConfig() {
return null;
}@Override
public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
System.out.println(“业务逻辑代码”);
}@Override
public String getServletInfo() {
return null;
}@Override
public void destroy() {
System.out.println(“servlet 销毁”);
}
}
————————————————
版权声明:本文为CSDN博主「SIMBA1949」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/SIMBA1949/article/details/91350125
来源:CSDN
作者:Mr.Hazy
链接:https://blog.csdn.net/MrHazy/article/details/102736068