I am relatively new to web development, and I am trying to develop a web application using Spring MVC 3.0.5 on WebLogic 10.3.4.
I’d like my JSPs to use external CSS files. For example, I have a JSP file with the following:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<LINK href="${pageContext.request.contextPath}/resources/css/ptostyles.css" rel="stylesheet" type="text/css">
<title>Register</title>
</head>
Unfortunately, the CSS file doesn’t seem to get loaded. I have tried putting it in various places. The current directory structure looks like:

Relevant portions of my web.xml include:
<servlet>
<servlet-name>springDispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/config/spring-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springDispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Resource Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.ResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>WebContent/*</url-pattern>
</servlet-mapping>
Any suggestions, including debugging strategies would be much appreciated!
I managed to access my CSS by doing the following:
by Sean
ResourceServlet.
I added the following line to spring-context.xml
This article discusses some other issues and workarounds that may be applicable to a WebLogic deployment. There appears to be a bug in the implementation of Spring 3.0.5 that can cause problems delivering static resources.