zoukankan      html  css  js  c++  java
  • Eclipse can not find the tag library descriptor for http://java.sun.com/jsf/*

    问题页面:

    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ page import="java.util.Calendar"%>
    <%@ page import="java.text.SimpleDateFormat"%>
    <link href="css/table-style.css" rel="stylesheet" type="text/css" />
    <html>
    <f:view>
        <head>
    <title>JSF 2.0 + Spring + Hibernate Example</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        </head>
        <body>
            <h1>JSF + Spring + Hibernate</h1>
            <h:form>
                <h:dataTable value="#{customer.customerList}" var="c"
                    styleClass="order-table" headerClass="order-table-header"
                    rowClasses="order-table-odd-row,order-table-even-row">
    
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Customer ID" />
                        </f:facet>
                        <h:outputText value="#{c.customerId}"></h:outputText>
                    </h:column>
    
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Name" />
                        </f:facet>
                        <h:outputText value="#{c.name}"></h:outputText>
                    </h:column>
    
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Address" />
                        </f:facet>
    
                        <h:outputText value="#{c.address}"></h:outputText>
                    </h:column>
    
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="Created Date" />
                        </f:facet>
    
                        <h:outputText value="#{c.createdDate}"></h:outputText>
                    </h:column>
    
                </h:dataTable>
            </h:form>
            <h2>Add New Customer</h2>
            <h:form>
    
                <h:panelGrid columns="3">
                
                    Name : 
                    <h:inputText id="name" value="#{customer.name}" size="20"
                        required="true" label="Name">
                    </h:inputText>
    
                    <h:message for="name" style="color:red" />
                
                    Address : 
                    <h:inputTextarea id="address" value="#{customer.address}" cols="30"
                        rows="10" required="true" label="Address">
                    </h:inputTextarea>
    
                    <h:message for="address" style="color:red" />
    
                </h:panelGrid>
    
                <h:commandButton value="Submit" action="#{customer.addCustomer()}" />
    
            </h:form>
        </body>
    </f:view>
    </html>

    solutions:

    1.project-->right click->properties->project Facets->add JavaServer Faces.

    then refresh and rebuild project again and again until the errors disappear.

    or

    2.changed your jsp page to xhtml,then modified the page taglib using the below snap:

    <!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://java.sun.com/jsf/html"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:ui="http://java.sun.com/jsf/facelets"> 

    done;

  • 相关阅读:
    骗分
    【WC2016】鏖战表达式
    emacs配置
    UOJ NOI Round #4补题
    调整法
    IOC(控制反转)与DI(依赖注入)的个人理解。
    WPF进阶技巧和实战06-控件模板
    WPF进阶技巧和实战05-样式与行为
    WPF进阶技巧和实战04-资源
    WPF进阶技巧和实战03-控件(2-特殊容器)
  • 原文地址:https://www.cnblogs.com/sos-blue/p/3286971.html
Copyright © 2011-2022 走看看