Tengo un problema con los selects en Spring.
Agradecería algún ejemplo donde pudiera tomar ideas de cuál es el problema
El error que tengo viene descrito más abajo por si alguien se atreve:
En el JSP tengo:
Código:
En el Java tengo:<div><form:select path="ad0"><form:option value=""/></form:select> <form:input path="textoAD9"></form:input> <form:select path="sImg0"><form:option value=""/></form:select></div> <div><form:select path="ad1"><form:option value=""/></form:select> <form:input path="textoAD1"></form:input> <form:select path="sImg1"><form:option value=""/></form:select></div> <div><form:select path="ad2"><form:option value=""/></form:select> <form:input path="textoAD2"></form:input> <form:select path="sImg2"><form:option value=""/></form:select></div> <div><form:select path="ad3"><form:option value=""/></form:select> <form:input path="textoAD3"></form:input> <form:select path="sImg3"><form:option value=""/></form:select></div> </div>
Código:
y el error que tengo espackage es.itecban.vm.service; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public class BookmarksSetup { protected final Log logger = LogFactory.getLog(getClass()); private String ad0; private String textoAD0; private String sImg0; private String ad1; private String textoAD1; private String sImg1; private String ad2; private String textoAD2; private String sImg2; private String ad3; private String textoAD3; private String sImg3; public String getAd0() { return ad0; } public void setAd0(String ad0) { this.ad0 = ad0; } public String getTextoAD0() { return textoAD0; } public void setTextoAD0(String textoAD0) { this.textoAD0 = textoAD0; } public String getSImg0() { return sImg0; } public void setSImg0(String img0) { sImg0 = img0; } public String getAd1() { return ad1; } public void setAd1(String ad1) { this.ad1 = ad1; } public String getTextoAD1() { return textoAD1; } public void setTextoAD1(String textoAD1) { this.textoAD1 = textoAD1; } public String getSImg1() { return sImg1; } public void setSImg1(String img1) { sImg1 = img1; } public String getAd2() { return ad2; } public void setAd2(String ad2) { this.ad2 = ad2; } public String getTextoAD2() { return textoAD2; } public void setTextoAD2(String textoAD2) { this.textoAD2 = textoAD2; } public String getSImg2() { return sImg2; } public void setSImg2(String img2) { sImg2 = img2; } public String getAd3() { return ad3; } public void setAd3(String ad3) { this.ad3 = ad3; } public String getTextoAD3() { return textoAD3; } public void setTextoAD3(String textoAD3) { this.textoAD3 = textoAD3; } public String getSImg3() { return sImg3; } public void setSImg3(String img3) { sImg3 = img3; } }
Código:
org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/jsp/personalizarAccesosDirectos.jsp at line 130 127: <h1>Accesos Directos para el segmento: <%= segmentoID %></h1> 128: <form:form method="post" commandName="bookmarksSetup"> 129: <div style="width:90%; border: 1px solid #CCCCCC; padding: 10px;"> 130: <div><form:select path="ad0" onchange="cambiarTexto('0')" onkeyup="cambiarTexto('0')"></form:select> <form:input path="textoAD0"></form:input> <form:select path="sImg0" onchange="cambiarImg('0')" onkeyup="cambiarImg('0')"></form:select> <img src="img/ico/plugins.gif" id="img0" width="32" height="32" border="0" /></div> 131: <div><form:select path="ad1" onchange="cambiarTexto('1')" onkeyup="cambiarTexto('1')"></form:select> <form:input path="textoAD1"></form:input> <form:select path="sImg1" onchange="cambiarImg('1')" onkeyup="cambiarImg('1')"></form:select> <img src="img/ico/plugins.gif" id="img1" width="32" height="32" border="0" /></div> 132: <div><form:select path="ad2" onchange="cambiarTexto('2')" onkeyup="cambiarTexto('2')"></form:select> <form:input path="textoAD2"></form:input> <form:select path="sImg2" onchange="cambiarImg('2')" onkeyup="cambiarImg('2')"></form:select> <img src="img/ico/plugins.gif" id="img2" width="32" height="32" border="0" /></div> 133: <div><form:select path="ad3" onchange="cambiarTexto('3')" onkeyup="cambiarTexto('3')"></form:select> <form:input path="textoAD3"></form:input> <form:select path="sImg3" onchange="cambiarImg('3')" onkeyup="cambiarImg('3')"></form:select> <img src="img/ico/plugins.gif" id="img3" width="32" height="32" border="0" /></div> Stacktrace: org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:429) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:167) org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:239) org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1158) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) causa raíz java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'bookmarksSetup' available as request attribute org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:142) org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:176) org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath(AbstractDataBoundFormElementTag.java:196) org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getName(AbstractDataBoundFormElementTag.java:147) org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.autogenerateId(AbstractDataBoundFormElementTag.java:134) org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.writeDefaultAttributes(AbstractDataBoundFormElementTag.java:123) org.springframework.web.servlet.tags.form.AbstractHtmlElementTag.writeDefaultAttributes(AbstractHtmlElementTag.java:379) org.springframework.web.servlet.tags.form.SelectTag.writeTagContent(SelectTag.java:198) org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:90) org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:77) org.apache.jsp.WEB_002dINF.jsp.personalizarAccesosDirectos_jsp._jspx_meth_form_005fselect_005f0(personalizarAccesosDirectos_jsp.java:309) org.apache.jsp.WEB_002dINF.jsp.personalizarAccesosDirectos_jsp._jspx_meth_form_005fform_005f0(personalizarAccesosDirectos_jsp.java:234) org.apache.jsp.WEB_002dINF.jsp.personalizarAccesosDirectos_jsp._jspService(personalizarAccesosDirectos_jsp.java:197) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:167) org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:239) org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1158) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803)