zoukankan      html  css  js  c++  java
  • web.xml 配置

    1. 配置 servlet

    <servlet>
    <servlet-name>hello</servlet-name>
    <servlet-class>test.HelloWorldHttpServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>hello</servlet-name>
    <url-pattern>/helloWorld</url-pattern>
    </servlet-mapping>

    2.配置 Filter

    <filter>
    <filter-name>authFilter</filter-name>
    <filter-class>test.LoginFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>authFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>

    3. 配置异常、错误

    <error-page>
    <error-code>404</error-code>
    <location>/error.jsp</location>
    </error-page>


    <error-page>
    <exception-type>javax.servlet.ServletException</exception-type>
    <location>/error.jsp</location>
    </error-page>

  • 相关阅读:
    python编码
    异常、调试
    python的优点
    循环、判断
    对象
    模块
    函数
    变量
    Socket编程(九)
    进程简单了解和使用
  • 原文地址:https://www.cnblogs.com/xiangjune/p/6526324.html
Copyright © 2011-2022 走看看