我正在使用 IBM RAD 8.5.1 创建 JSF 2 项目并在 websphere 8.5 上运行它
我使用了文件 > 新建 > Web 项目向导 ,我添加了 JSF 和 Primefaces,如下所示:
Java 构建路径 > 添加外部 jar
- jsf-api-2.1.7.jar (com.sun.faces)
- jsf-impl-2.1.7.jar (com.sun.faces)
- primefaces-3.3.1.jar
项目方面是:
- 动态网络模块 3
- Java 1.6
- JavaScript 1
- JavaServer Faces 2
- JSTL 1.1
- WebSphere Web(共存)8.5
- WebSphere Web(扩展)8.5
xhtml页面:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:p="http://primefaces.org/ui"
xmlns:pretty="http://ocpsoft.com/prettyfaces"
xmlns:sec="http://www.springframework.org/security/tags"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
<title> Welcome </title>
</h:head>
<h:body>
<p:layout fullPage="true">
<p:layoutUnit position="north" size="100" header="Top" resizable="true" closable="true" collapsible="true">
<h:outputText value="North unit content." />
</p:layoutUnit>
<p:layoutUnit position="south" size="100" header="Bottom" resizable="true" closable="true" collapsible="true">
<h:outputText value="South unit content." />
</p:layoutUnit>
<p:layoutUnit position="west" size="200" header="Left" resizable="true" closable="true" collapsible="true">
<h:outputText value="West unit content." />
</p:layoutUnit>
<p:layoutUnit position="east" size="200" header="Right" resizable="true" closable="true" collapsible="true" effect="drop">
<h:outputText value="Right unit content." />
</p:layoutUnit>
<p:layoutUnit position="center">
<h:form>
This fullPage layout consists of five different layoutUnits which are resizable and closable by default.
</h:form>
</p:layoutUnit>
</p:layout>
</h:body>
</html>
web.xml:
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>vip</display-name> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> <enabled>true</enabled> <async-supported>false</async-supported> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern> /faces/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file> pages/hello.xhtml </welcome-file> </welcome-file-list> </web-app>
在 IE 9 上运行该项目时,primefaces 组件未渲染,我只获取中心的文本 layoutUnit
请告知如何解决这个问题,谢谢。
最佳答案
请确保您的 Primefaces jar 应位于构建路径中的 Web 应用程序库中。最简单的方法是将 primeface jar 文件复制并粘贴到 Web 项目中的/WebContent/WEB-INF/lib 中。实现后,请检查您的编辑器/IDE,同时输入 p: 如果您看到 p:{all Tags} 则表明它已正确实现
关于jakarta-ee - Primefaces 组件在 websphere 8.5 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16033878/