当我尝试返回到没有重定向的同一页面时,我收到以下错误。
org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.IllegalStateException: Duplicate component ID '_id20' found in view.
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:527)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
root cause
javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.IllegalStateException: Duplicate component ID '_id20' found in view.
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.view_005fneed_jsp._jspService(view_005fneed_jsp.java:556)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
root cause
java.lang.IllegalStateException: Duplicate component ID '_id20' found in view.
com.sun.faces.application.StateManagerImpl.checkIdUniqueness(StateManagerImpl.java:201)
com.sun.faces.application.StateManagerImpl.checkIdUniqueness(StateManagerImpl.java:204)
com.sun.faces.application.StateManagerImpl.saveSerializedView(StateManagerImpl.java:97)
com.sun.faces.taglib.jsf_core.ViewTag.doAfterBody(ViewTag.java:189)
org.apache.jsp.view_005fneed_jsp._jspx_meth_f_005fview_005f0(view_005fneed_jsp.java:741)
org.apache.jsp.view_005fneed_jsp._jspService(view_005fneed_jsp.java:546)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
我有一个自定义组件,它只是在DataTable中呈现HTML以及h:form(也在数据表中)。
我的bean是Request level Bean,JSF版本是 Implementation-Version:1.1_02-b08
[编辑]我的自定义组件位于Datatable中我认为这会产生问题, 此外,页面中没有Ajax操作。
我的jsp看起来像这样......
<h:datatable>
<h:column>
<ch:activity name="#{need.name}" />
</h:column>
CH:活动是自定义组件
答案 0 :(得分:1)
生成了_idxx
个ID,可能是您的自定义组件中出现了一些错误。您通常应该为每个组件提供一个自定义ID,否则AJAX函数可能无法正常工作 - 如果您使用它们。
你能发布你的JSP / XHTML吗? 你能检查一下你的渲染器(它是一个自定义渲染器,对吧?)两次渲染相同的ID吗?