struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Engle <>
Subject Re: CSS background images, struts2
Date Wed, 05 Aug 2009 03:41:41 GMT
I made my CSS files out of JSPs, like so:

<%@ page contentType="text/css"%>
<%@ taglib uri="" prefix="c" %>

body {
  background-color: #ECEDF1;
  font-family: 'Lucida Grande',Geneva,Verdana,Arial,sans-serif;
  background-image: url(<c:url value="/images/background/header_background.png"/>);
  margin-top: 0px;
  padding: 0;

And then called them like this:

<link rel="stylesheet" href="<html:rewrite page="/css/style.css.jsp"/>" type="text/css">

Who cares if it's ugly or whatever; I don't have broken images in my apps anymore.  :)


----- Original Message ----
From: Andy Law <>
Sent: Tuesday, August 4, 2009 5:00:12 PM
Subject: Re: CSS background images, struts2

Wes Wannemacher wrote:
> One thing I've done in the past is to treat CSS files as JSPs and use
> s:url tags or EL expressions (${contextRoot}/images/image.gif)...

Oooooh. That feels soooo dirty!!!

There has to be a cleaner way to do it.


View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message