I wrote an application in Java with Spring framework. In web.xml I define servlet mapping and when I use “/” pattern I get nice url for example “/login”,”/register” it’s fine but access to static resource like .jpg or .css is blocked. If I use pattern like “*.html” resources works fine but I don’t want url like “/login.html”.
How to solve this?
Setup a resource handler in your dispatcher servlet configuration. This will allow all requests that have
/resources/within the url pattern to avoid being routed by the dispatcher servlet. When using this configuration you will need to place all of your static resources within a directory named resources.Documentation