Skip to main content

rendering after primefaces resources.

5 replies [Last post]
justinwyer
Offline
Joined: 2008-11-24

Hi all, primefaces 2 is using jsf 2.0 resource loading to load its resources, unfortunately mojarra is rendering them after my tags. This makes overriding css nigh impossible,

Should this behavior be considered correct? If not I will log a bug. If this is corrent then can I possibly override the way that is rendered so it appears after the primefaces resources?

Reply viewing options

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

It depends on how primefaces is loading the resource. If the load is
happening in the component itself, then the problem is that you are
calling *before* the call in the component.

Try putting the at the end of your document, and
see if that fixes it.

Jim

On 1/25/10 4:57 AM, webtier@javadesktop.org wrote:
> Hi all, primefaces 2 is using jsf 2.0 resource loading to load its resources, unfortunately mojarra is rendering them after my tags. This makes overriding css nigh impossible,
>
> Should this behavior be considered correct? If not I will log a bug. If this is corrent then can I possibly override the way that is rendered so it appears after the primefaces resources?
> [Message sent by forum member 'justinwyer' (justin@lifeasageek.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=382766
>
> ---------------------------------------------------------------------
> 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

justinwyer
Offline
Joined: 2008-11-24

Thanks Jim, placing at the bottom of the document did the trick.

mlbrooks
Offline
Joined: 2008-08-03

I am using Windows XP with Netbeans 6.9 M1.

I am using JSF 2.0 and maven 2.2 and Glassfish V3.

In my index.xhtml, I am using:
although I have tried library="css" and name="styles.css"

When I created a stylesheet, I put it in the following
directory:
c:\MyWebApps\MyProj\src\main\resources\css\styles.css

After doing a build, it was in the following directories:
c:\MyWebApps\MyProj\target\classes\css\styles.css
c:\MyWebApps\MyProj\target\MyProj\WEB-INF\classes\css\styles.css

In MyProj.war (using WinZip)
\WEB-INF\classes\css\styles.css

I used the Admin Console to deploy and launch.

When I launched MyProj, the web page was displayed but
there was no CSS styling.
When I view page source, I see:

I found the following in the server log
INFO: MyProj was successfully deployed in 5,266 milliseconds.
WARNING: JSF1064: Unable to find or serve resource, styles.css, from library, /WEB-INF/classes/css.
WARNING: JSF1064: Unable to find or serve resource, resources/css/styles.css.
WARNING: JSF1064: Unable to find or serve resource, css/styles.css.

What am I missing?????

Ryan Lubke

On 3/11/10 7:38 AM, webtier@javadesktop.org wrote:
> I am using Windows XP with Netbeans 6.9 M1.
>
> I am using JSF 2.0 and maven 2.2 and Glassfish V3.
>
> In my index.xhtml, I am using:
> although I have tried library="css" and name="styles.css"
>
> When I created a stylesheet, I put it in the following
> directory:
> c:\MyWebApps\MyProj\src\main\resources\css\styles.css
>
> After doing a build, it was in the following directories:
> c:\MyWebApps\MyProj\target\classes\css\styles.css
> c:\MyWebApps\MyProj\target\MyProj\WEB-INF\classes\css\styles.css
>
> In MyProj.war (using WinZip)
> \WEB-INF\classes\css\styles.css
>
Your resources need to be in stored within the resources directory (off
the docroot),
not in WEB-INF/classes.
> I used the Admin Console to deploy and launch.
>
> When I launched MyProj, the web page was displayed but
> there was no CSS styling.
> When I view page source, I see:
>
>
> I found the following in the server log
> INFO: MyProj was successfully deployed in 5,266 milliseconds.
> WARNING: JSF1064: Unable to find or serve resource, styles.css, from library, /WEB-INF/classes/css.
> WARNING: JSF1064: Unable to find or serve resource, resources/css/styles.css.
> WARNING: JSF1064: Unable to find or serve resource, css/styles.css.
>
> What am I missing?????
> [Message sent by forum member 'mlbrooks' (mykelbrooks@sbcglobal.net)]
>
> http://forums.java.net/jive/thread.jspa?messageID=391280
>
> ---------------------------------------------------------------------
> 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

mlbrooks
Offline
Joined: 2008-08-03

Thanks Ryan and I apologize. After rereading your New Features in JSF 2.0 - Resources blog entries, you stated the answer to my problem pretty explicitly. Thanks again for getting me on the right path again.