I am currently trying to include a css file in my FreeMarker * .ftl. I also configured the resource folder in the xml file of the servlet file.
<mvc:resources mapping="/resources/**" location="/resources/" />
But how can I access my css file from my FreeMarker template?
I just tried the following, but to no avail.
<link href="/resources/css/style.css" rel="stylesheet" type="text/css" />
The resource folder is in the root directory of my spring MVC 3.0 application.
/web /resources /img /css /WEB-INF /templates
My servlet root is defined as:
<servlet> <servlet-name>springmvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springmvc</servlet-name> <url-pattern>/web/*</url-pattern> </servlet-mapping>
My FreeMarker files are in the templates folder.
source share