I'm using annotation-driven configuration and I've added the following to my servlet-context.xml:
The file (style.css) resides in WebContent folder, but it is not served. I get this message in the log file:
Generally, I would rather serve static files as just files with web server, but I don't want an extra path in the url so that I can change servlet mapping from / to say 'app', just to be able to access static files.
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"> <property name="defaultHandler"> <!-- If no @Controller match, map path to a view to render; e.g. the "/index" path would map to the view named "index". --> <bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController" /> </property> </bean>
noHandlerFound No mapping found for HTTP request with URI [/sso-web/style.css] in DispatcherServlet