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

2021/7/11 14:06:48

本文主要是介绍'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'

 

 

原因:

    <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>

 



这篇关于'com.shi.filter.Filter' is not assignable to 'javax.servlet.Servlet,jakarta.servlet.S的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程