加载JSF页面时的HTTP状态代码500(内部服务器错误)

时间:2013-05-05 01:27:09

标签: jsf jsf-2 richfaces tomcat6

<!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>

在我尝试访问该页面后,我收到了以下错误:

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)

谁能告诉我我做错了什么?

2 个答案:

答案 0 :(得分:1)

其中一个标签中有拼写错误:

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

应该是

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

答案 1 :(得分: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实现的。