webtier@glassfish.java.net

JSF2: How can I use resources in JavaScript ?

From: <webtier_at_javadesktop.org>
Date: Tue, 19 Jan 2010 01:31:21 PST

Hello,

How can I use resources in JavaScript?
I can use <h:outputStylesheet /> or <h:outputScript/> in .xhtml.
When use the above tags, it will generate a completed path of the resources.

I am going to build a calendar component with JSF2. Some of my calendar javascripts require to use some images that locating under the resources folder. How can I use them in this case?

/META-INF/
   - resources/
         - calendar
               - css
                  - calendar.css
               - images
                  - cal.gif
                  - prev.gif
                  - next.gif
               - js
                 - calendar.js
               - calendar.xhtml

My question is that how can I use "cal.gif" in "calendar.js" ?
[Message sent by forum member 'ericmacau' (ericmacau_at_gmail.com)]

http://forums.java.net/jive/thread.jspa?messageID=381654