What is the difference between / and /* in web.xml ?
for the dispatcher servlet / is used and i guess this means all the requests.In that case what does url-pattern "/*" means ?
/*
means "all requests", whereas /
means "all requests not handled by other servlets".
In particular, a common source of confusion is that /*
overrides mappings of built-in servlets, such as JSP servlet. It means that if you map DispatcherServlet
to /*
, you won't be able to use JSP-based views, because requests to render these views will be handler by DispatcherServlet
itself rather than by JSP servlet that actually renders JSP pages.
That's why DispatcherServlet
that should handle all requests is usually mapped to /
.
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