[英]web.xml intellij is not auto completing when adding servlet or filter
當我在eclipse中創建servlet或過濾器時,xml代碼會自動插入到web.xml中。 但是當我在Intellij中做同樣的事情時,我需要手動編輯xml文件。
當我在Intellij中鍵入下面的代碼時,我得到一個錯誤“過濾器應該有映射”但是為什么當我使用下面的代碼時這不會自動創建。
<filter>
<filter-name>TestFilter</filter-name>
<filter-class>be.demoapp.filters.TestFilter</filter-class>
</filter>
必須有一個非常簡單的答案,但我無法弄清楚為什么Intellij不會自動完成web.xml和eclipse。 或者我需要打開一些插件。 我找不到一個好的答案嗎?
在你的課程中,使用注釋@WebFilter(name = "TestFilter", urlPatterns = "/TestFilter")
它不會在web.xml
顯示,但它會起作用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.