Tapestry 5.1 has an asset protection scheme that requires some
configuration to allow access to asset files on the classpath; even
innocuous things such as stylesheet files.  Unless you understand the
configuration, you'll see Assets exported as URLs that result in a
404.  As you saw, moving them to the web application context bypasses
the issue.

This has been radically simplified in Tapestry 5.2; things are a bit
more wide open, but still safe.

On Thu, Apr 29, 2010 at 2:53 AM, Elisabeth Adler
<elisabeth.ad...@gmail.com> wrote:
> Thanks for the tips!
>
> I resolved the issue by moving the component from my external component .jar
> file (which is included in my application) into my actual application, where
> it worked without any problems. It was the same code but everything worked
> there.
>
> Thanks again,
> Elisabeth
>
> On 25.04.2010 12:11, Alex Kotchnev wrote:
>>
>> Elisabeth,
>>    when you include the stylesheet in the way you show, it should show up
>> as
>> an
>>
>> <LINK href="mystyle.css" rel="stylesheet" type="text/css">
>>
>> element in the<head />  section of the document that is produced. Can you
>> show the resulting rendered output ?
>>
>> I do recall that there was some discussion in the past that if the tml
>> being
>> rendered was not an HTML document, the stylesheets shouldn't be added
>> (e.g.
>> imagine, if you were trying to render XML, adding a head element with
>> stylesheet links would be just wrong), which might be what's happening
>> here.
>> Try adding a regular HTML skeleton code around where you use the component
>> (e.g.<html><head></head><body><t:mytest.tabset/></body></html>) and see if
>> that helps.
>>
>> Regards,
>>
>> Alex K
>>
>> Can you show the
>> On Sat, Apr 24, 2010 at 5:14 PM, Elisabeth Adler
>> <elisabeth.ad...@gmail.com>wrote:
>>
>>
>>>
>>> Hi there,
>>>
>>> I am building my own tapestry component (TabSet) which I want to give a
>>> certain style. The problem is that the CSS is somehow not applied, even
>>> though it looks like it finds it (if I change the path in the code where
>>> I
>>> include the stylesheet, it complains it can't find the file, so if I
>>> don't
>>> get the error I asume the file is available).
>>> When I check the css file with Firebug, it says "There are no rules in
>>> this
>>> stylesheet."
>>> I am using Tapestry Version: 5.0.19 and I am including my own component
>>> within a jar in my original page. Please find the code below.
>>>
>>> Anybody any idea what I am missing?
>>> Thanks a lot!
>>> Elisabeth
>>>
>>> Code:
>>> **** css ****
>>> DIV.tabSet {     background-color: #efefef;  }
>>>
>>> **** tml ****
>>> <div id="${clientId}" class="tabSet" xmlns:t="
>>> http://tapestry.apache.org/schema/tapestry_5_0_0.xsd";>
>>> <p>testing it</p>
>>> </div>
>>>
>>> **** java ****
>>> @IncludeJavaScriptLibrary(value = {"TabSet.js"})
>>> @IncludeStylesheet(value = {"TabSet.css"})
>>> public class TabSet implements ClientElement
>>> {
>>>    //parameters and more defined here
>>> }
>>>
>>> **** using the component in another tml****
>>> <t:mytest.tabset/>
>>>
>>> **** File Locations ****
>>> tml, js and css in: src/main/resources/my/test/common/components
>>> java in: src/main/java/my/test/common/components
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>>
>>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

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

Reply via email to