Having trouble figuring out where to place my public files. I attempted the solution mentioned in this thread on Stack Overflow but it didn't work for me.
I've tried putting my public folder in various locations within the WEB-INF
directory, but still no luck.
This is a snippet from my web.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<display-name>s-mvc</display-name>
<servlet>
<servlet-name>frontController</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>frontController</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<mvc:resources mapping="/css/**" location="/css/"/>
</web-app>
This is part of my frontcontroller-servlet.xml configuration:
<mvc:annotation-driven/>
<context:component-scan base-package="pl.skowronline.controller" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/views/"/>
<property name="suffix" value=".jsp"/>
</bean>
This is how I am referencing my CSS file:
<link type="text/css" href="/css/bootstrap.css" rel="stylesheet" />