开发者

Duplicate Id error when using custom component in JSF1.1 with DataTable

开发者 https://www.devze.com 2023-03-02 18:54 出处:网络
I am getting the following error when i try to return to same page without redirect. org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.Illeg

I am getting the following error when i try to return to same page without redirect.

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.apach开发者_开发百科e.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)

I am having a custom component which just renders HTML inside the DataTable along with a h:form(also inside the datatable).

My bean is Request level Bean and the JSF version is Implementation-Version: 1.1_02-b08

[EDIT] My custom component is inside a Datatable I think thats creating the problem, Also there is no Ajax action in the page.

My jsp looks like this..

<h:datatable>
<h:column>
<ch:activity name="#{need.name}" />

</h:column>

Where CH:activity is a custom component


Those _idxx ids are generated and maybe there's some error in your custom component. You should generally give each component a custom id, since otherwise AJAX functions might not work correctly - should you use them.

Could you post your JSP/XHTML?
Can you check that your renderer (its a custom one, right?) doesn't render the same id twice?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号