I have a Servlet mapping in my application with out a servlet defined for it.
Eclipse produces a warning on it:
The servlet mapping "/docs/*" refers to a servlet that is not defined
<servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>/docs/*</url-pattern> </servlet-mapping>
There is no defined servlet default. But it is only a warrning, the application itself works fine and serves content from that url pattern.
Is there a "default" servlet that handles those servlet mappings? if not? how does this even work?
Additional Info
I have another mapping like so and it has a servlet:
com.sun.jersey.spi.spring.container.servlet.SpringServlet
<servlet-mapping> <servlet-name>springDispatcher</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping>
So to Kayaman's answer. if i remove the "redundant" mapping. the /docs functionality stops working.
what i actually want is to know what servlet is the default one so i can create a servlet for my mapping and avoid the warnings.
Thanks.
Oracle docs:
Each Web application has a default servlet. This default servlet can be a servlet that you specify, or, if you do not specify a default servlet, WebLogic Server uses an internal servlet called the FileServlet as the default servlet.
You can register any servlet as the default servlet. Writing your own default servlet allows you to use your own logic to decide how to handle a request that falls back to the default servlet.
Setting Up a Default Servlet
Tomcat Specific
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