When i create a servlet or a filter in eclipse the xml code is automatically insert into the web.xml. But when i do the same thing in Intellij i need to manually edit the xml file.
When i type the code below in Intellij i get an error "filter should have mapping" But why is this not automatically created when i use the code below.
<filter>
<filter-name>TestFilter</filter-name>
<filter-class>be.demoapp.filters.TestFilter</filter-class>
</filter>
There has to be a very simple answer for this but i can't figure out why Intellij does not auto complete the web.xml and eclipse does. Or do i need to turn on some plugin. I can't find a good answer on this ?
*Edit these are the settings in my project

Inside your class, use the annotation @WebFilter(name = "TestFilter", urlPatterns = "/TestFilter")
It won't show in web.xml but it will do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With