'com.shi.filter.Filter' is not assignable to 'javax.servlet.Servlet,jakarta.servlet.S

出现:

'com.shi.filter.Filter' is not assignable to 'javax.servlet.Servlet,jakarta.servlet.Servlet'

'com.shi.filter.Filter' is not assignable to 'javax.servlet.Servlet,jakarta.servlet.S

 

 

原因:

    <servlet>
        <servlet-name>Filter</servlet-name>
        <servlet-class>com.shi.filter.Filter</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Filter</servlet-name>
        <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>

解决:

    <filter>
        <filter-name>Filter</filter-name>
        <filter-class>com.shi.filter.Filter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>Filter</filter-name>
        <url-pattern>/servlet/*</url-pattern>
    </filter-mapping>

 

上一篇:一起谈.NET技术,关于技术争论(尤其是ASP.NETWebForms 和 ASP.NETMVC 之争)


下一篇:十三 .Flask wtforms组件和选择框动态数据实时更新