3 Replies Latest reply on Oct 9, 2008 10:43 PM by yf guo

    com.sun.facelets.FaceletException: Error Parsing /style.css

    yf guo Newbie

      I am writing a portlet, and try it with css.
      Following the reference guide, I created jboss-portlet.xml under WEB-INF with the content:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE portlet-app PUBLIC
       "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
       "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
      <portlet-app>
       <portlet>
       <portlet-name>InventoryPortlet</portlet-name>
       <header-content>
       <link rel="stylesheet" type="text/css" href="/style.css"/>
       </header-content>
       </portlet>
      </portlet-app>
      


      And I placed the style.css under .war with simple content just for test:
      body {
       background:rgb(100, 100, 0)
      }
      
      table {
       border:1px solid rgb(100, 100, 0);
       height:600px
      }
      


      I got the follwing exception when I accessed the portlet:
      09:40:10,734 ERROR [STDERR] 2008-10-8 9:40:10 com.sun.facelets.FaceletViewHandle
      r handleRenderException
      严�: Error Rendering View[/style.css]
      com.sun.facelets.FaceletException: Error Parsing /style.css: Error Traced[line:
      1] Content is not allowed in prolog.
       at com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:234)
      
       at com.sun.facelets.compiler.Compiler.compile(Compiler.java:105)
       at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFace
      letFactory.java:197)
       at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFacelet
      Factory.java:144)
       at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFacelet
      Factory.java:95)
       at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java
      :517)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.jav
      a:567)
       at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWra
      pper.java:108)
       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.j
      ava:189)
       at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderRes
      ponseExecutor.java:41)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java: