tomcat ider配置
xml文件配置:
<servlet>
<servlet-name>test1</servlet-name>//设定java文件链接的锚点
<servlet-class>cs</servlet-class>//cs为java文件的名字:cs.java
</servlet>
<servlet-mapping>
<servlet-name>test1<servlet-name>//设定锚点链接绳索
<url=pattern>/use</url=pattern>//设定浏览器使用的虚拟地址
</servlet-mapping>
import javax.servlet.*;
import java.io.IOException;
public class cs implements Servlet{//继承:implements servlet
@Override
public void init(ServletConfig servletConfig) throws ServletException {
}
@Override
public ServletConfig getServletConfig() {
return null;
}
@Override
public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
System.out.println("This change has come into effect!");
}
@Override
public String getServletInfo() {
return null;
}
@Override
public void destroy() {
}
}