当前位置: 代码迷 >> Java Web开发 >> ServletException: #{user.show}: javax.faces.el.MethodNotFoundException:
  详细解决方案

ServletException: #{user.show}: javax.faces.el.MethodNotFoundException:

热度:771   发布时间:2016-04-17 12:43:07.0
jsf错误急
HTTP Status 500 - 

--------------------------------------------

type Exception report

message 

description The server encountered an internal error () that prevented it from fulfilling this request.

exception 

javax.servlet.ServletException: #{user.show}: javax.faces.el.MethodNotFoundException: show: java.util.TreeMap.show()
javax.faces.webapp.FacesServlet.service(FacesServlet.java:209)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)


root cause 

javax.faces.FacesException: #{user.show}: javax.faces.el.MethodNotFoundException: show: java.util.TreeMap.show()
com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
javax.faces.component.UICommand.broadcast(UICommand.java:312)
javax.faces.component.UIData.broadcast(UIData.java:657)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.

弄表界面
  <f:view>
  <h:form>
  <center>
  <h:dataTable title="用户信息" bgcolor="red" var="user" value="#{user.all}" border="1" width="80%">
  <h:column>
  <f:facet name="header">
  <h:outputText value="编号">
  </h:outputText>
  </f:facet>
  <h:outputText value="#{user.id}">
  </h:outputText>
  </h:column>

  <h:column>
  <f:facet name="header">
  <h:outputText value="用户名">
  </h:outputText>
  </f:facet>
  <h:outputText value="#{user.name}">
  </h:outputText>
  </h:column>

  <h:column>
  <f:facet name="header">
  <h:outputText value="密码">
  </h:outputText>
  </f:facet>
  <h:outputText value="#{user.pwd}">
  </h:outputText>
  </h:column>

  <h:column>
  <f:facet name="header">
  <h:outputText value="修改"></h:outputText>
  </f:facet>
  <h:commandLink action="#{user.show}">
  <f:param value="#{user.id}" name="ID">
  </f:param>
  <h:outputText value="修改">
  </h:outputText>
  </h:commandLink>
  </h:column>

  <h:column>
  相关解决方案