1. 程式人生 > >javaweb中的xml檔案報錯:Multiple annotations found at this line:

javaweb中的xml檔案報錯:Multiple annotations found at this line:

今天在學習java web中的Filter的時候在配置xml檔案的報了一個錯誤:

Multiple annotations found at this line:     - <?xml version="1.0" encoding="UTF-8"?>     - The processing instruction target matching "[xX][mM][lL]" is not       allowed.

 然後找了一下問題所在,報錯原因是因為在xml的第一行前面

<?xml version="1.0" encoding="UTF-8"?>

多了一個空格(可能是不小心按了空格),把空格刪掉就可以了

解決方法:

將第一行前面的空格刪掉即可