You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Christy Kudlac <ck...@silverpop.com> on 2007/02/15 22:18:08 UTC

[S2] Attempting to load static resources from my own jar file

Hello, all.

 

I have built a custom jar which, in addition to classes, contains some
static javascript and css files.  I'm deploying an exploded war to
tomcat 5.5 which has this jar in it's lib.  I was hoping that my static
resource files within my jar would be loaded to allow jsps to reference
these files.  Looking around, it looks like I should just have to
specify in struts.properties the following settings to have these files
loaded:

struts.serve.static=true

struts.serve.static.browserCache=true

 

Some additional info, I have placed my js and css files in package
structures such as:  com.mycompany.static.  And they are being
referenced from within the jsp using:

<link rel="stylesheet" type="text/css" href="<s:url
value="/struts/header.css"/>">

 

When my page loads, it's pretty apparent that the style sheets are not
being referenced.  I've additionally used "header.css" and "/header.css"
in the value to see if those worked, but no such luck.  I'm running
against S2 2.0.4.

 

Any help would be greatly appreciated!!!

 

 

Regards,

 

Christy Kudlac

Senior Software Engineer

Silverpop

200 Galleria Pkwy, Suite 750

Atlanta, GA  30339