2013-05-05 67 views
0
<!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"> 

<body> 
<h:form><center> 
    <h:panelGrid columns="2"> 
     <h:outputText value="Login: " /> 
     <h:inputText value="#{usBusiness.user.login}"/> 
     <h:outputText value="mot de passe:" /> 
     <h:inpuText value="#{usBusiness.user.pwd}" /> 
     <h:commandButton id="submit" action="#{usBusiness.user.connecter}" value="connecter" /> 
     <h:commandButton id="submit" action="#{usBusiness.user.connecter}" value="annuler" /> 
    </h:panelGrid> 
</center></h:form> 
</body> 
</html> 

後,我試圖訪問的頁面,我得到了以下錯誤:HTTP狀態代碼500(內部服務器錯誤),而加載的JSF頁面

There was an internal server error that prevented it from fulfilling the request. 

例外:

javax.servlet.ServletException: /authentification.xhtml @12,49 <h:inpuText> Tag Library supports namespace: http://java.sun.com/jsf/html, but no tag was defined for name: inpuText 
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:270) 
    org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178) 
    org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290) 
    org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390) 
    org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517) 

誰能告訴我我做錯了什麼?

+0

歡迎來到Stack Overflow!在我們的社區中,英語是*事實上*唯一使用的語言。這一次我翻譯了你的問題,但下一次你自己做,或者不要發表任何問題。 – skuntsel 2013-05-05 08:49:00

回答

1

沒有在標籤中的一個錯字:

<h:inpuText value="#{usBusiness.user.pwd}" /> 

應該

<h:inputText value="#{usBusiness.user.pwd}" /> 
+0

謝謝你真的是一個錯誤的愚蠢 – 2013-05-05 13:30:55

1

如果做出正確的縮進,並仔細閱讀你的錯誤描述這將是很清楚給你,錯誤是微不足道的:而不是行

<h:inpuText value="#{usBusiness.user.pwd}" /> 

注:inpuText,它應該是

<h:inputText value="#{usBusiness.user.pwd}" /> 

注:inputText的,這是錯誤描述中明確指出:

javax.servlet.ServletException: /authentification.xhtml @12,49 <h:inpuText> Tag Library supports namespace: http://java.sun.com/jsf/html, but no tag was defined for name: inpuText 

順便說一句,你<center>標籤的使用已過時。現在它根本不被使用,所有的樣式都是通過使用CSS來實現的。

相關問題