You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Hensley, Richard" <Ri...@McKesson.com> on 2004/09/10 01:55:24 UTC
page specific style sheets
I have a desire for page specific style sheets.
I have a
main.css stylesheet that is located in ./style/
print.css stylesheet that is located in ./style/
These are declared as external asset's, and work great.
and I want a
page.css stylesheet that is located in ./WEB-INF/pages/ right along side of
my page.page and page.html. I went about this doing the following:
<context-asset name="pagestyle" path="./WEB-INF/pages/SignIn.css"/>
By when I use the following code:
writer.beginEmpty("link");
writer.attribute("rel","stylesheet");
writer.attribute("type", "text/css");
writer.attribute("href", asset.buildURL(cycle));
writer.println();
I get html that looks like:
<link rel="stylesheet" type="text/css" href="/wo/WEB-INF/pages/SignIn.css"/>
Which does not work because the web server does not allow requests for
things in WEB-INF.
What I really need is an Asset that is colocated with the specification that
can be returned by the application. Is there such a thing?
By the way, when I move the SignIn.css outside the WEB-INF directory, it
works just fine.
Richard
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: page specific style sheets
Posted by Terry Poot <tp...@goldenvoid.com>.
I know there's a way to tell Tapestry to move assets to a web-accessible
folder when they're referenced, but I don't remember where I read about
it. The book mentions it, so I know Tapestry 3.0 still does that, but
the book doesn't tell how to do it.
Ah, there it is, check the Javadoc for the class AssetExternalizer. It
copies assets from the classpath to a specified directory, for which you
give it the URL.
Hensley, Richard wrote:
>I have a desire for page specific style sheets.
>
>I have a
>
>main.css stylesheet that is located in ./style/
>print.css stylesheet that is located in ./style/
>
>These are declared as external asset's, and work great.
>
>and I want a
>
>page.css stylesheet that is located in ./WEB-INF/pages/ right along side of
>my page.page and page.html. I went about this doing the following:
>
> <context-asset name="pagestyle" path="./WEB-INF/pages/SignIn.css"/>
>
>
>By when I use the following code:
>
> writer.beginEmpty("link");
> writer.attribute("rel","stylesheet");
> writer.attribute("type", "text/css");
> writer.attribute("href", asset.buildURL(cycle));
> writer.println();
>
>I get html that looks like:
>
><link rel="stylesheet" type="text/css" href="/wo/WEB-INF/pages/SignIn.css"/>
>
>Which does not work because the web server does not allow requests for
>things in WEB-INF.
>
>What I really need is an Asset that is colocated with the specification that
>can be returned by the application. Is there such a thing?
>
>By the way, when I move the SignIn.css outside the WEB-INF directory, it
>works just fine.
>Richard
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org