2011-07-11 12 views
6

मैं सोच रहा था कि क्या मैं बाहरी संसाधनों से सीएसएस को लिंक करने के लिए <h:outputStylesheet/> का उपयोग कर सकता हूं। मैं याहू ग्रिड को जोड़ना चाहता हूं। निम्नलिखित कोड का उपयोग करना, मुझे मिल गया एक RES_NOT_FOUND:जेएसएफ 2.0 बाहरी संसाधनों से सीएसएस को कैसे लिंक करें

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" 
     xmlns:f="http://java.sun.com/jsf/core"  
     xmlns:h="http://java.sun.com/jsf/html" 
     xmlns:p="http://primefaces.prime.com.tr/ui" 
     xmlns:tcmt="http://java.sun.com/jsf/composite/tcmt/component"> 

    <h:head> 
    </h:head> 
    <h:body> 
     <h:outputStylesheet library="css" name="http://yui.yahooapis.com/3.3.0/build/cssgrids/grids-min.css" target="head" /> 
    </h:body> 
</html> 

उत्तर

13

मैं सोचता यह है कि आप का उपयोग अधिक उपयुक्त है:

<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.3.0/build/cssgrids/grids-min.css" /> 

मुझे यकीन है कि नहीं हूँ, लेकिन जब आप <h:graphicImage/> या का उपयोग <h:outputStylesheet/> आप करना चाहते हैं फ़ोल्डर resources है, जो उदाहरण के लिए नाम सीएसएस है अंदर है कि कुछ फ़ोल्डर मतलब (जो सिर्फ ज़ाहिर है, स्टाइलशीट है करने के लिए जा रहा है;))

चित्र:

<h:graphicImage library="images" name="picuture.jpg" /> 

सीएसएस:

<h:outputStylesheet library="css" name="grids-min.css" target="head" /> 

उदा:

 
WebContent 
    resources 
     images 
     // images 
     css 
     // stylesheets 

मेरे सुझाव है:

<link type="text/css" rel="stylesheet" href="http://yui.yahooapis.com/3.3.0/build/cssgrids/grids-min.css" /> 

या आप इस .css डाउनलोड करने और संसाधनों में अपने सीएसएस फ़ोल्डर में डाल दिया।

संबंधित मुद्दे