*strong text*I'm a beginner in the world of Spring and I've encountered some difficulties when it comes to linking CSS and JS files. Here's an excerpt from my jsp file:
<html lang="es-MX">
<head>
<title>Cambio Musical</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- These are the problematic CSS and JS files -->
<link href="reset.css" rel=stylesheet>
<link href="menuSuperior.css" rel=stylesheet>
<link href="style.css" rel=stylesheet>
<link href='http://fonts.googleapis.com/css?family=Skranji' rel='stylesheet'>
<link rel="stylesheet" href="estilo.css" />
<!-- The main CSS file -->
<link href="reloj.css" rel=stylesheet" />
<link rel="shortcut icon" href="logo.ico">
<!--[if lt IE 9]>
<script src="assets/js/html5.js"></script>
<![endif]-->
<script type="text/javascript" src="jquery-1.3.2.js"></script>
<script type="text/javascript" src="scriptboton.js"></script>
<!-- These are the problematic CSS and JS files -->
</head>
<body>
<div id="contenedor">
<!-- Header starts here -->
<div id="cabecera">
<div id="logo"><img src="logo.png" width=100px height=60px>
<div id='cssmenu'>
<ul>
<li class='has-sub'><a href='index'><span>Home</span></a></li>
<li class='has-sub'><a href='getParList'><span>Participants</span></a>
<ul>
<li class='has-sub'><a href='participants'><span>Add Participant</span></a></li>
<li class='has-sub'><a href='getParList'><span>Show Participants</span></a></li>
</ul>
</li>
<li class='has-sub'><a href='devent'><span>Events</span></a>
<ul>
<li class='has-sub'><a href='event'><span>Add Event</span></a></li>
<li class='has-sub'><a href='devent'><span>Show Events</span></a></li>
</ul>
</li>
<li class='has-sub'><a href='searchmusic'><span>Music</span></a>
<ul>
<li class='has-sub'><a href='music'><span>Add Music</span></a></li>
<li class='has-sub'><a href='searchmusic'><span>Show Music</span></a></li>
</ul>
</li>
<li class="has-sub"><a href="/result"><span>Results</span></a>
<ul>
<li class='has-sub'><a href='result'><span>Overall Results</span></a></li>
<li class='has-sub'><a href='sexRes'><span>Results By Gender</span></a></li>
<li class='has-sub'><a href='ageRes'><span>Results By Age</span></a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
This is how my Dispatcher Servlet looks like:
<!-- Declaring base package -->
<context:component-scan base-package="cambio.packs" />
<!-- Adding view resolver to display JSPs on the browser -->
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
And this is the error message shown in the reference: Apache Tomcat/7.0.22 - Error Report
HTTP Status 404 -
Type State Report
Message
Description The requested resource () is not available.
Apache Tomcat/7.0.22
This is my XML configuration:
<display-name>ElCambio</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
spring org.springframework.web.servlet.DispatcherServlet 2
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping><listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>