【问题标题】:PrimeFaces not rendering in Intellij 2017.2.6PrimeFaces 未在 Intellij 2017.2.6 中呈现
【发布时间】:2017-11-23 19:34:07
【问题描述】:

我正在尝试创建一个使用 Primefaces 和 Intellij 的非 maven jsf Web 项目。

服务器启动,我可以看到页面,但我没有呈现任何 primefaces 标签,这是 index.html

<?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:h="http://xmlns.jcp.org/jsf/html"
  xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
  xmlns:f="http://xmlns.jcp.org/jsf/core"
  xmlns:p="http://primefaces.org/ui">

<h:head></h:head>

<h:body>
<p:outputLabel value="primefaces"/>
<h:outputLabel value="jsf"/>
</h:body>

当页面打开时,我只能看到 jsf,我编写的任何 primefaces p 组件都不会被渲染,我可以使用 netbeans 但使用 intellij i 轻松创建看起来像这样的项目有这个问题。

这是 web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
     version="3.1">
<listener>
    <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
</listener>
<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet>
    <description>JAX-WS endpoint</description>
    <display-name>WSServlet</display-name>
    <servlet-name>WSServlet</servlet-name>
    <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>WSServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
</servlet-mapping>

这是 .iml 文件

<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="web" name="Web">
  <configuration>
    <descriptors>
      <deploymentDescriptor name="web.xml" url="file://$MODULE_DIR$/web/WEB-INF/web.xml" />
    </descriptors>
    <webroots>
      <root url="file://$MODULE_DIR$/web" relative="/" />
    </webroots>
  </configuration>
  <facet type="webservices" name="WebServices">
    <configuration ws.engine="Glassfish / JAX-WS 2.2 RI / Metro 1.X / JWSDP 2.2" />
  </facet>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
  <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="GlassFish 4.1.2 - JSF" level="application_server_libraries" />
<orderEntry type="library" name="Primefaces" level="project" />
<orderEntry type="library" scope="PROVIDED" name="GlassFish 4.1.2" level="application_server_libraries" />
<orderEntry type="library" name="JAX-WS-Glassfish / JAX-WS 2.2 RI / Metro 1.X / JWSDP 2.2" level="project" />
</component>
</module>

【问题讨论】:

    标签: jsf intellij-idea primefaces


    【解决方案1】:

    它可以帮助你Intellij Jsf with tomcat issue starting web page

    检查war文件是否包含primefaces依赖

    【讨论】:

      【解决方案2】:

      同理,项目结构 > 工件 > 可用元素 > Primefaces Intellij Jsf with tomcat issue starting web page

      【讨论】:

      • 只需投票并接受给定的答案并删除这个
      猜你喜欢
      • 2012-07-19
      • 2011-11-15
      • 2013-06-08
      • 1970-01-01
      • 2023-03-22
      • 2015-04-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多