亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

嘗試用Filter 實現跨域時,提示is not assignable to 'javax

嘗試用Filter 實現跨域時,提示is not assignable to 'javax

Helenr 2019-03-20 17:15:32
實現跨域時,配置 web.xml時提示:CORSFilter is not a concrete classCORSFilter is not assignable to 'javax,servlet.Filter'是什么原因?-----------------------------web.xml---------------------------------------------<?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"     version="3.1"><!--display-name 顯示名稱--><display-name>wechat-baggio</display-name><servlet>    <servlet-name>WxServlet</servlet-name>    <!--<servlet-class>boilerWeChat.servlet.WxServlet</servlet-class>-->    <servlet-class>boilerWeChat.servlet.WxServlet</servlet-class>    <!--自動啟動-->    <load-on-startup>1</load-on-startup></servlet><!-- url-pattern中配置的/WxServlet用于指定該Servlet的訪問路徑 --><servlet-mapping>    <servlet-name>WxServlet</servlet-name>    <url-pattern>/WxServlet</url-pattern></servlet-mapping><!--<welcome-file-list>-->    <!--<welcome-file></welcome-file>--><!--</welcome-file-list>-->**<filter>    <filter-name>CORSFilter</filter-name>    <filter-class>boilerWeChat.servlet.CORSFilter</filter-class>    /**這里提示錯誤:boilerWeChat.servlet.CORSFilter is not a concrete class;boilerWeChat.servlet.CORSFilteris not assignable to 'javax,servlet.Filter'**/    <init-param>        <param-name>charset</param-name>        <param-value>UTF-8</param-value>    </init-param></filter><filter-mapping>    <filter-name>CORSFilter</filter-name>    <url-pattern>/*</url-pattern></filter-mapping>**</web-app>
查看完整描述

1 回答

?
吃雞游戲

TA貢獻1829條經驗 獲得超7個贊

public abstract class CORSFilter implements Filter 你使用了抽象類去實現Filter肯定不行,請將abstract去掉


查看完整回答
反對 回復 2019-04-22
  • 1 回答
  • 0 關注
  • 1692 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號