繁体   English   中英

WebLogic 10.3.6上未呈现的JSF标签

[英]JSF tags not rendered on WebLogic 10.3.6

我制作了简单的facelet,但是没有渲染标签。 已获得支持bean的价值,但未呈现标签。 我还为网络服务使用apache cxf。

应用程序服务器:WebLogic 10.3.6

Web.xml:

 <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</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>
    <welcome-file-list>
        <welcome-file>index.xhtml</welcome-file>
    </welcome-file-list>

依存关系:

<dependency>
         <groupId>com.sun.faces</groupId>
         <artifactId>jsf-api</artifactId>
         <version>2.0.0-b13</version>
         <scope>compile</scope>
      </dependency>

  <dependency>
     <groupId>com.sun.faces</groupId>
     <artifactId>jsf-impl</artifactId>
     <version>2.0.0-b13</version>
     <scope>compile</scope>
  </dependency>

  <dependency>
     <groupId>javax.servlet</groupId>
     <artifactId>jstl</artifactId>
     <version>1.2</version>
  </dependency>

  <dependency>
     <groupId>javax.servlet</groupId>
     <artifactId>servlet-api</artifactId>
     <version>2.5</version>
  </dependency>

Xhtml facelet:

<?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">
<h:head>
    <title>DIS</title>
    <h:outputScript library="javascript" name="jquery.js"/>
    <h:outputScript library="primefaces" name="primefaces.js"/>
    <h:outputScript library="javax.faces" name="jsf.js"/>
</h:head>

<h:body>
    <h:outputLabel value="#{sessionViewBean.test}"/>
</h:body>
</html>

输出页面:

<?xml version="1.0" encoding="UTF-8"?>
<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">
<h:head>
    <title>DIS</title>
    <h:outputScript library="javascript" name="jquery.js"></h:outputScript>
    <h:outputScript library="primefaces" name="primefaces.js"></h:outputScript>
    <h:outputScript library="javax.faces" name="jsf.js"></h:outputScript>
</h:head>

<h:body>
    <h:outputLabel value="lolka"></h:outputLabel>
</h:body>
</html>

如果有人感兴趣,我找到了解决方法,我的错误是在xhtml页面上。 h标签的xmlns定义错误xmlns:h="http://xmlns.jcp.org/jsf/html"

正确的是xmlns:h="http://java.sun.com/jsf/html"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM