Skip to main content

JSF 2.0 Resourceloading problem in CSS using outputStyle tag

2 replies [Last post]
f_schebelle
Offline
Joined: 2009-12-01
Points: 0

Hi @all!

I'm using Glassfish 2.1.1 with JSF Mojarra 2.0.1 and have the following problem.

I created a composite component and added the related CSS definition with the new tag.
The CSS file contains image path definitions, relative to the CSS location. The problem is that no image will be displayed.

Component:
...

...

CSS:

.itemList table thead .header {
text-align: left;
padding-left: 10px;
background: #ccccff url(../img/table_sort_none.gif) no-repeat center left;
cursor: pointer;
}

After the rendering the image path in CSS looks like this, inspected with firebug:

background: #CCCCFF url(table_sort_none.gif) no-repeat scroll left center

and the CSS file path:
http://localhost:7302/vc/javax.faces.resource/components/css/itemList.cs...

I think the problem is the javax.faces.resource in the CSS path and the automated flatten of the relative image path.

Does anyone knows a solution for this problem, except to use the old style of linking the CSS file? Or is this a bug?

thank you,
florian

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Ryan Lubke

On 12/1/09 12:01 PM, webtier@javadesktop.org wrote:
> Hi @all!
>
> I'm using Glassfish 2.1.1 with JSF Mojarra 2.0.1 and have the following problem.
>
> I created a [b]composite component[/b] and added the related CSS definition with the new [b][/b] tag.
> The CSS file contains image path definitions, relative to the CSS location. The problem is that no image will be displayed.
>
> Component:
> [b]...
>
> ...[/b]
>
> CSS:
>
> [b] .itemList table thead .header {
> text-align: left;
> padding-left: 10px;
> background: #ccccff url(../img/table_sort_none.gif) no-repeat center left;
> cursor: pointer;
> }[/b]
>
> After the rendering the image path in CSS looks like this, inspected with firebug:
>
> [b]background: #CCCCFF url(table_sort_none.gif) no-repeat scroll left center[/b]
>
> and the CSS file path:
> http://localhost:7302/vc/javax.faces.resource/components/css/itemList.cs...
>
> I think the problem is the [b]javax.faces.resource[/b] in the CSS path and the automated flatten of the relative image path.
>
> Does anyone knows a solution for this problem, except to use the old style of linking the CSS file? Or is this a bug?
>
Try:

background: #ccccff url(#{resource['components/img/table_sort_none.gif']}) no-repeat center left;

> thank you,
> florian
> [Message sent by forum member 'f_schebelle' ]
>
> http://forums.java.net/jive/thread.jspa?messageID=374152
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: webtier-help@glassfish.dev.java.net

f_schebelle
Offline
Joined: 2009-12-01
Points: 0

Wow!
Life can be so easy! :-)

Thanks a lot,
florian