For tap 3.0.x and 4.0.x assuming you use the Insert component,
http://tapestry.apache.org/tapestry4/tapestry/ComponentReference/Insert.html
set the raw attribute to true.

For tap 4.1.x, there's already a component for correctly including a css
http://tapestry.apache.org/tapestry4.1/components/Style.html





jake123 wrote:
Hi, I have some problems with my custom components. Each of the components have
their own CSS so I need to insert a tag like this for the component:
<link jwcid="cssLink" href="/default/css/topbar.css" rel="stylesheet"
type="text/css" />
this tag will not end up in the <head> tag but actually in the body of the
html.
The results come out like this (disregard the white spaces in the biginning
and the end): & l t ; link href="/default/css/topbar.css" type="text/css" rel="stylesheet"
/ & g t ;

So, the problem is that tapestry converts the html symbols instead of
serving html tags. It also does the same for a image tags.

I have in my java code  this method:
        public String getCssLink() {
                /* Get the link for the right css */
                String templateName = getSessionUserInfo().getTemplateName();
                return "<link href=\"/" + templateName + "/css/topbar.css\"
type=\"text/css\" rel=\"stylesheet\" />";
        }

Is this the wrong approach? If so, how should I do this instead?

Thanks
Jacob

--
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting


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

Reply via email to