I'm completely new to web technologies and try to write my first Spring MVC application. I have following problem:
My project has following structure:
classes - compuled java code (controllers etc.)
views - jsp pages
lib - Spring and other libraries
css - folder with my css filesI use <mvc:resources> in following way:
My understanding here is that I "map" /resources to /css directory.
<mvc:resources mapping="/resources/**" location="/css/" cache-period="31556926" />
I run my application using Glassfish server (ver. 3.1.2) and see in the log following enrty:
It seems to be OK. Next I'll try to use my css file within jsp using:
Mapped URL path [/resources/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
where s points to :
<link rel="stylesheet" href="<s:url value="/resources/main.css" />" type="text/css">
And this doesn't work without any information. I'll try to get access to main.css file directly from the browser but always get HTTP Status 404 - The requested resource is not available. Any help will be very appreciated.
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>