4
Я получаю домашнюю страницу, но при переходе на страницу JSP, у которой есть h:inputText
, я получаю следующее ошибка:Невозможно преобразовать # {ad.userid} типа class java.lang.String в класс javax.faces.component.UIComponent
root cause javax.servlet.ServletException: javax.servlet.jsp.JspException: org.apache.jasper.el.JspELException: /login.jsp(21,0) '#{ad.userid}' Cannot convert #{ad.userid} of type class java.lang.String to class javax.faces.component.UIComponent org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791) org.apache.jsp.login_jsp._jspService(login_jsp.java:83) 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:542) com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:359) com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:150) com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:96) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135) javax.faces.webapp.FacesServlet.service(FacesServlet.java:309) root cause org.apache.jasper.el.JspELException: /login.jsp(21,0) '#{ad.userid}' Cannot convert #{ad.userid} of type class java.lang.String to class javax.faces.component.UIComponent org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:107) com.sun.faces.application.ApplicationImpl.createComponentApplyAnnotations(ApplicationImpl.java:1878) com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:443) javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:218) javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:483) javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:667) javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1139) com.sun.faces.taglib.html_basic.InputTextTag.doStartTag(InputTextTag.java:424) org.apache.jsp.login_jsp._jspx_meth_h_005finputText_005f0(login_jsp.java:253) org.apache.jsp.login_jsp._jspx_meth_h_005fform_005f0(login_jsp.java:168) org.apache.jsp.login_jsp._jspx_meth_f_005fview_005f0(login_jsp.java:113) org.apache.jsp.login_jsp._jspService(login_jsp.java:76) 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:542) com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:359) com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:150) com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:96) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135) javax.faces.webapp.FacesServlet.service(FacesServlet.java:309)
thank u .i am get, но поля ввода заполнены # {ad.userid}, как на всех страницах. И даже несмотря на то, что я ввел в них допустимые значения, они получают нулевые значения в управляемом компоненте , пожалуйста, ответьте – john
Если на ваш ** текущий ** вопрос/проблему ответили/решили, вы должны отметить этот ответ принят (отметьте галочку с левой стороны). Если у вас есть ** новый вопрос **, вы должны нажать кнопку «Спросить вопрос» справа вверху, чтобы опубликовать его, не злоупотреблять комментариями или другими вопросами/ответами для него :) См. Также http: // stackoverflow. ком/чаво – BalusC