This is a conscious decision, that you will know early on what the
context path will be.

The effort to avoid this in T4, using a <base> tag, caused far more
problems than it solved.

A solution using query parameters is likewise: it makes your site
off-limits to any kind of search engine, and it tends to create longer
and less "pretty" URLs.

On 3/12/07, D&J Gredler <[EMAIL PROTECTED]> wrote:
I've never had to operate out of a context other than root, so I've just
hardcoded it to "/mystyle.css" or whatever...


On 3/12/07, Bogdan Calmac <[EMAIL PROTECTED]> wrote:
>
> Consider a UserDetail page that has an URL like
> "http://server/context/UserDetail/jdoe";. Here I'm using the tapestry
> style of passing parameters, as part of the context. The problem here
> is that if you have a styleset link to "mystyle.css", it will try to
> look for "http"://server/context/userdetail/mystyle.css" which of
> course does not exit. The alternative to use the full path to the css,
> "/context/mystyle.css" is also bad because you don't want to hardcode
> the name of the context.
>
> There are 2 correct solutions to this problem which would be nice to
> be part of the framework:
>
> 1. Allow context information to (optionally) be passed to a page as
> query parameters, so the above URL would be
> "http://server/context/UserDetail?userid=jdoe";. The relative link to
> the stylesheet would be fine now, but I don't know if this fits with
> the design of the framework.
>
> 2. Create something like an AssetLink component that takes care to
> prepend so context, so that:
>
>   <link t:type="AssetLink" href="/mystyle.css" rel="stylesheet"
> type="text/css"/>
>
> would generate;
>
> <link href="/context/mystyle.css" rel="stylesheet" type="text/css"/>
>
>
> I would expect there were others who encountered the same quirk. How
> did you address it?
>
> Thank you,
> Bogdan Calmac.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to