PrimeFaces components don't display while standard JSF components render fine

前端 未结 2 949
甜味超标
甜味超标 2020-12-12 03:21

Java EE6/CDI JSF2 Primefaces 3.3.1. I created a search page with a few cascading dropdowns that are used to generate a table of search results If I use jsf:



        
相关标签:
2条回答
  • 2020-12-12 03:44

    To add one other reason to BalusC's list:

    If you don't add servlet URL mapping to your URL, you will get weird output and JSF won't parse your XHTML pages!

    For example, if you have the following URL mapping in web.xml:

    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    

    you should use /faces/yourpage.xhtml to render the output correctly by JSF.

    If you use /yourpage.xhtml you will see weird output.

    0 讨论(0)
  • 2020-12-12 03:47

    Thus, the <p:xxx> tags are not been parsed as JSF tags at all and appear plain vanilla in the generated HTML output. That can have one or more of the following reasons:

    1. You forgot to declare the p: XML namespace in the view, or you used the wrong namespace URI. It should be:

      xmlns:p="http://primefaces.org/ui"
      
    2. You forgot to actually install the PrimeFaces library. It should be a matter of either

      a. Dropping primefaces.jar in webapp's /WEB-INF/lib folder.

      b. Making sure your dependency manager (e.g. Maven) has been configured to add PrimeFaces to the project and added it to the runtime /WEB-INF/lib folder

    0 讨论(0)
提交回复
热议问题