My web application is built on Spring MVC and runs on Tomcat 7.0. We have also implemented the Tiles framework in our application.
Below is the snippet of code for the layout page where I have included CSS and javascript files:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html; charset=utf-8" language="java"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Application</title>
<!-- CSS Files -->
<link type="text/css" href="<c:url value='/resources/css/themes/base/jquery.ui.all.css'/>">
<link type="text/css" href="<c:url value='/resources/css/styles.css'/>" />
<!-- Javascript Files -->
<script src="<c:url value='/resources/scripts/jquery/jquery-1.7.1.js'/>"></script>
<script src="<c:url value='/resources/scripts/jquery/ui/jquery.ui.core.js'/>"></script>
<script src="<c:url value='/resources/scripts/jquery/ui/jquery.ui.widget.js'/>"></script>
<script src="<c:url value='/resources/scripts/jquery/ui/jquery.ui.button.js'/>"></script>
<script src="<c:url value='/resources/scripts/common.js'/>"></script>
<script>
$(function() {
$("input:submit, a, input:button", ".buttonDiv").button();
$("a", ".buttonDiv").click(function() {
return false;
});
});
</script>
</head>
<body>
<div id="container">
<div id="header">
<tiles:insertAttribute name="header">
<tiles:putAttribute name="menu"
value="/WEB-INF/jsps/common/menu.jsp" />
</tiles:insertAttribute>
</div>
<div id="body">
<tiles:insertAttribute name="body" />
</div>
<div id="footer">
<tiles:insertAttribute name="footer" />
</div>
</div>
</body>
</html>
The javascript files are loading correctly, but there seems to be an issue with loading the CSS files.
Additionally, here is an excerpt from my Spring configuration file:
<!-- Handles HTTP GET requests for /resources/** by efficiently serving
up static resources in the ${webappRoot}/resources/ directory -->
<mvc:resources location="/resources/" mapping="/resources/**" />
I am currently using IE7 browser for testing purposes and facing difficulties. Any advice or help regarding the CSS file inclusion would be highly appreciated.