Servlet

1.Eclipse的tomcat插件:当改变类和方法的结构时需要重启(改变了参数,增删方法或者类时

仅仅改变方法中的内容时不需要重启

每次改变web.xml文件时也需要重启

2.Java Enumeration接口

http://www.runoob.com/java/java-enumeration-interface.html

3.web.xml文件中

servlet-class 一定要在servlet-name之后

即:<servlet-name>....</servlet-name>

<servlet-class>....</servlet-class>

 4.Eclipse的分屏

ctrl + shift + [

5.@WebServlet("/reg")相当于web.xml中配置的那8行代码

其中引号中的内容和url-pattern必须完全相同 一定不能忘记加/

6.今日份BUG:

The servlets named [x] and [y] are both mapped to the url-pattern [/JServlet] which is not permitted

原因:web.xml文件配置重复  @webServlet("/")和web.xml文件只需要配置一个即可

当都配置时会出现上面的错误

原文地址:https://www.cnblogs.com/AmosWong/p/9332320.html