8 Replies Latest reply on Apr 27, 2011 11:43 AM by javacorner

    richfaces CSS and JS file don't upload

    javacorner

      Hi all,

      I'm working with richfaces4. I found that all the JS actions in my application don't work. also no styles for the HTML elements in my application. I compared my web pages after running the applicaion by using "view" source in the web browser and the online ricfaces4 dimo. I found the dirrerence is many js and css files loaded in the page of online demo and didn't load in my page .

      I think these file located in the  JARs of richfaces4 which I added to my application and they should loaded automatically to the running web page but this doesn't happen

       

      demo url; http://richfaces-showcase.appspot.com/

       

      the files that I talking about are:

      <link type="text/css" rel="stylesheet" href="/static-resources/blueSky/skinning.css" /><link type="text/css" rel="stylesheet" href="/javax.faces.resource/application.css.jsf?ln=css" /><script type="text/javascript" src="/static-resources/javax.faces/jsf.js"></script><script type="text/javascript" src="/static-resources/jquery.js"></script><script type="text/javascript" src="/static-resources/richfaces.js"></script><script type="text/javascript" src="/static-resources/richfaces-queue.js"></script><script type="text/javascript" src="/static-resources/richfaces-event.js"></script><script type="text/javascript" src="/static-resources/richfaces-base-component.js"></script><script type="text/javascript" src="/static-resources/org.richfaces/panelMenu.js"></script><script type="text/javascript" src="/static-resources/org.richfaces/panelMenuItem.js"></script><script type="text/javascript" src="/static-resources/org.richfaces/panelMenuGroup.js"></script><link type="text/css" rel="stylesheet" href="/static-resources/blueSky/org.richfaces.css/icons.css" /><link type="text/css" rel="stylesheet" href="/static-resources/blueSky/org.richfaces.css/panelMenu.css" /><link type="text/css" rel="stylesheet" href="/static-resources/blueSky/org.richfaces.css/tabPanel.css" /><script type="text/javascript" src="/static-resources/org.richfaces/togglePanel.js"></script><script type="text/javascript" src="/static-resources/org.richfaces/tabPanel.js"></script><script type="text/javascript" src="/static-resources/org.richfaces/togglePanelItem.js"></script><script type="text/javascript" src="/static-resources/org.richfaces/tab.js"></script><script type="text/javascript" src="/static-resources/js/shCore.js"></script><link type="text/css" rel="stylesheet" href="/static-resources/org.richfaces.css/shCore.css" /><link type="text/css" rel="stylesheet" href="/static-resources/org.richfaces.css/shThemeDefault.css" /><script type="text/javascript" src="/static-resources/js/shBrushJScript.js"></script><script type="text/javascript" src="/static-resources/js/shBrushJava.js"></script><script type="text/javascript" src="/static-resources/js/shBrushXml.js"></script><script type="text/javascript" src="/static-resources/js/shBrushCss.js"></script><script type="text/javascript" src="/static-resources/js/shBrushPlain.js"></script><style type="text/css">

      .navigation .rf-tab-hdr-brd,.navigation .rf-tab {

      display: none;

      }

      </style><style type="text/css">
              .outhello {
                  font-weight: bold;
              }
          </style><style type="text/css">
                .sourceView{
                     padding-top: 10px;
                }
           </style>
        • 1. richfaces CSS and JS file don't upload
          ppitonak

          Hi Mostafa,

           

          please check that you included <h:head/> in your page.

           

          Palo

          • 2. richfaces CSS and JS file don't upload
            javacorner

            Dear Pavol,

            Many thanks for reply

            So I should to call the JS and CSS files that are used for JSF and rich faces explicitly to the XHTML page?

            in <head> tag in my template page I added the CSS and JS files that are related to  my application and I don't added the JSF and rich faces default required files.

             

            Regards,

            Mostafa

            • 3. richfaces CSS and JS file don't upload
              ppitonak

              JSF and RichFaces resources are included on the page automatically but <h:head> (JSF tag) is needed. Standard html <head> tag is not sufficient.

               

              You can look at RichFaces Showcase's template http://anonsvn.jboss.org/repos/richfaces/trunk/examples/richfaces-showcase/src/main/webapp/templates/main.xhtml.

               

              Regards,

              Palo

              1 of 1 people found this helpful
              • 4. richfaces CSS and JS file don't upload
                javacorner

                I got ur point man . thank you : I will check it then reply.

                • 5. richfaces CSS and JS file don't upload
                  javacorner

                  Hello.

                  I change it to <f;head> then I faced following error:

                  /template/master.xhtml at line 8 and column 9 <f:head> Tag Library supports namespace: http://java.sun.com/jsf/core, but no tag was defined for name: head

                   

                  and following is my page master.xhtml:

                   

                  <!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:ui="http://java.sun.com/jsf/facelets"

                      xmlns:a4j="http://richfaces.org/a4j">

                  <f:view contentType="text/html">

                   

                      <f:head>

                          <title>E-skool | <ui:insert name="title"></ui:insert></title>

                          <meta name="keywords" content="e skool" />

                          <meta name="description" content="smart school" />

                   

                          <link type="text/css" rel="stylesheet"

                              href="/static-resources/blueSky/skinning.css" />

                          <link type="text/css" rel="stylesheet"

                              href="/javax.faces.resource/application.css.jsf?ln=css" />

                          <script type="text/javascript"

                              src="/static-resources/javax.faces/jsf.js"></script>

                          <script type="text/javascript" src="/static-resources/jquery.js"></script>

                          <script type="text/javascript" src="/static-resources/richfaces.js"></script>

                          <script type="text/javascript"

                              src="/static-resources/richfaces-queue.js"></script>

                          <script type="text/javascript"

                              src="/static-resources/richfaces-event.js"></script>

                          <script type="text/javascript"

                              src="/static-resources/richfaces-base-component.js"></script>

                          <script type="text/javascript"

                              src="/static-resources/org.richfaces/panelMenu.js"></script>

                          <script type="text/javascript"

                              src="/static-resources/org.richfaces/panelMenuItem.js"></script>

                          <script type="text/javascript"

                              src="/static-resources/org.richfaces/panelMenuGroup.js"></script>

                          <link type="text/css" rel="stylesheet"

                              href="/static-resources/blueSky/org.richfaces.css/icons.css" />

                          <link type="text/css" rel="stylesheet"

                              href="/static-resources/blueSky/org.richfaces.css/panelMenu.css" />

                          <link type="text/css" rel="stylesheet"

                              href="/static-resources/blueSky/org.richfaces.css/tabPanel.css" />

                          <script type="text/javascript"

                              src="/static-resources/org.richfaces/togglePanel.js"></script>

                          <script type="text/javascript"

                              src="/static-resources/org.richfaces/tabPanel.js"></script>

                          <script type="text/javascript"

                              src="/static-resources/org.richfaces/togglePanelItem.js"></script>

                          <script type="text/javascript"

                              src="/static-resources/org.richfaces/tab.js"></script>

                          <script type="text/javascript" src="/static-resources/js/shCore.js"></script>

                          <link type="text/css" rel="stylesheet"

                              href="/static-resources/org.richfaces.css/shCore.css" />

                          <link type="text/css" rel="stylesheet"

                              href="/static-resources/org.richfaces.css/shThemeDefault.css" />

                          <script type="text/javascript"

                              src="/static-resources/js/shBrushJScript.js"></script>

                          <script type="text/javascript"

                              src="/static-resources/js/shBrushJava.js"></script>

                          <script type="text/javascript"

                              src="/static-resources/js/shBrushXml.js"></script>

                          <script type="text/javascript"

                              src="/static-resources/js/shBrushCss.js"></script>

                          <script type="text/javascript"

                              src="/static-resources/js/shBrushPlain.js"></script>

                          <style type="text/css">

                  .navigation .rf-tab-hdr-brd,.navigation .rf-tab {

                      display: none;

                  }

                  </style>

                          <style type="text/css">

                  .sourceView {

                      padding-top: 10px;

                  }

                  </style>

                   

                   

                          <link

                              href="#{facesContext.externalContext.requestContextPath}/images/b1.ico"

                              rel="bookmark"></link>

                          <link

                              href="#{facesContext.externalContext.requestContextPath}/css/Admin.css"

                              rel="stylesheet" type="text/css" />

                          <link

                              href="#{facesContext.externalContext.requestContextPath}/css/tree.css"

                              rel="stylesheet" type="text/css" />

                          <link

                              href='#{facesContext.externalContext.requestContextPath}/images/b1.ico'

                              rel="shortcut icon"></link>

                          <link

                              href="#{facesContext.externalContext.requestContextPath}/css/style.css"

                              rel="stylesheet" type="text/css" media="screen" />

                          <script

                              src="#{facesContext.externalContext.requestContextPath}/js/app.js"

                              type="text/javascript"></script>

                          <script

                              src="#{facesContext.externalContext.requestContextPath}/js/jquery-1.5.2.js"

                              type="text/javascript"></script>

                          <script

                              src="#{facesContext.externalContext.requestContextPath}/js/menu.js"

                              type="text/javascript"></script>

                          <script

                              src="#{facesContext.externalContext.requestContextPath}/js/slideShow.js"

                              type="text/javascript"></script>

                      </f:head>

                      <f:body dir="ltr">

                          <!--  <f:loadBundle  basename="messages" var="msg" />   -->

                          <div id="my_wrapper">

                              <div id="header">

                                  <ui:insert name="header">

                                      <ui:include src="header.xhtml" />

                                      <ui:include src="my_menu.xhtml" />

                                  </ui:insert>

                              </div>

                   

                   

                              <div id="content_wrapper">

                                  <div id="content">

                                      <h2>

                                          <ui:insert name="content_title"></ui:insert>

                                      </h2>

                                      <!--                 <ui:insert name="slideshow"></ui:insert> -->

                   

                                      <p> </p>

                                      <ui:insert name="content_body"></ui:insert>

                   

                   

                                  </div>

                                  <div class="side">

                                      <div id="sidebar_top"></div>

                   

                                      <ui:insert name="side_menu">

                                          <ui:include src="side_menu.xhtml" />

                                      </ui:insert>

                                      <div id="sidebar_top"></div>

                                      <ui:insert name="login_area">

                                          <ui:include src="login_area.xhtml" />

                                      </ui:insert>

                                  </div>

                   

                   

                                  <ui:insert name="my_copyright">

                                      <ui:include src="my_copyright.xhtml" />

                                  </ui:insert>

                   

                   

                              </div>

                          </div>

                      </f:body>

                  </f:view>

                  </html>

                  • 6. richfaces CSS and JS file don't upload
                    javacorner

                    I am using the following JARs:

                     

                    batik-1.1.1.jar

                    commons-beanutils-1.8.3.jar

                    commons-codec-1.3.jar

                    commons-collections-3.2.jar

                    commons-digester-1.8.jar

                    commons-logging-1.1.1.jar

                    cssparser-0.9.5-sources.jar

                    geronimo-validation_1.0_spec-1.0-CR5.jar

                    guava-r08.jar

                    jstl.jar

                    myfaces-api-2.0.4.jar

                    myfaces-bundle-2.0.4.jar

                    myfaces-impl-2.0.4.jar

                    richfaces-components-api-4.0.0.Final.jar

                    richfaces-components-ui-4.0.0.Final.jar

                    richfaces-core-api-4.0.0.Final.jar

                    richfaces-core-impl-4.0.0.Final.jar

                    standard.jar

                    • 7. richfaces CSS and JS file don't upload
                      ppitonak

                      Hi,

                       

                      it should be <h:head> not <f:head>

                      1 of 1 people found this helpful
                      • 8. richfaces CSS and JS file don't upload
                        javacorner

                        yes. it is working.

                        Many thanks Palo for ur great support.

                        I like this community