I have a question regarding CSS and images residing externally on the
filesystem.

My goal is to provide a T5 application in which users can brand accordingly
through CSS and I do not want to provide access to the application ROOT.

I have successfully been able to inline stream the CSS file and alter the
background with a URL pointing to a web server:

/opt/user/webapp/layout.css

body {
    margin: 0;
    padding: 0;
    background: url( http://www.my_images.com/assets/background1.gif
)repeat-x;
}

It also works when I use a URL relative to ROOT (this is the default
out-of-the-box setting):

body {
    margin: 0;
    padding: 0;
    background: url( layout/images/background1.gif )repeat-x;
}

It does not work when I use an absolute URL to the filesystem:

body {
    margin: 0;
    padding: 0;
    background: url( file:///opt/user/webapp/background1.gif )repeat-x;
}

Firebug reports: Failed to load given URL.

I have tried many variations with the path name such as having the css and
image in the same directory or underneath and the file permissions are wide
open.

Is there a setting or something that I may have overlooked that will
instruct tapestry to resolve the filesystem url?

Just in-case it matters, this is the line in Layout.tml:

<link href=”${layoutCss}” rel=”stylesheet” type=”text/css”/>

And in Layout.java

public  Link getLayoutCss() throws Exception {
     return resources.createFormEventLink( “GET_LAYOUT_CSS_STREAM_EVENT” );
 }

@OnEvent( “GET_LAYOUT_CSS_STREAM_EVENT” )
private StreamResponse getLayoutCssStream() throws Exception {
    StreamResponse css = null;
    …
     // details for converting filesystem url into StreamResponse
    return css;
}

Thanks.


--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/External-CSS-tp4975506p4975506.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to