надеюсь, что вы, ребята, поможете мне решить эту проблему, когда я попытаюсь получить getById и выполнить проверку поверх модального окна начальной загрузки, чтобы получить эту ошибку !!Я не знаю, что делать! 1 Что-то не так на уровне кода, пожалуйста, дайте мне знать, ребята
SEVERE: Servlet.service () для servlet [jsp] вызвала исключение java.lang.IllegalStateException: ни BindingResultни простой целевой объект для имени компонента «update», доступный как атрибут запроса в org.springframework.web.servlet.support.BindStatus. (BindStatus.java:144) в org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStat(AbstractDataBoundFormElementTag.java:168) в org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath (AbstractDataBoundFormElementTag.java:188) в org.springframement.ataETataBataFataBataFD: 154) at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.autogenerateId (AbstractDataBoundFormElementTag.java:141) в org.springframework.web.servlet.tags.form.Aorm AbstractFoundFoundFoundFoundElementTag.java:132) в org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.writeDefaultAttributes (AbstractDataBoundFormElementTag.java:116) в org.springframework.wegformt.EgTefTackThereTHT422) в org.springframework.web.servlet.tags.form.InputTag.writeTagContent (InputTag.java:142) в org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal (AbstractFormTag.java:84).springframework.web.servlet.tags..Manage_005fTemplate_jsp._jspx_meth_form_005fform_005f0 (Manage_005fTemplate_jsp.java:924) в org.apache.jsp.WEB_002dINF.views.Manage_005fTemplate_jsp._jspj.jp_jp_p_p_W_W_W_P_P_W_W_W_W_W_P_W_W_W_W_W_W_W_W_W_W_W_W_W_W_W_W_W_W_W_W_W_W_W_W_W_W_P_W_W_W_P_P_P_P_W_P_P_W_P_P_WBase.java:70) в javax.servlet.http.HttpServlet.service (HttpServlet.java:742) в org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:443) в org.aplet.jper.JspServlet.serviceJspFile (JspServlet.java:386) в org.apache.jasper.servlet.JspServlet.service (JspServlet.java:330) в javax.servlet.http.HttpServlet.service (HttpServlet).apache.catalina.core.WsFilter.java:52) по адресу org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:193) по адресу org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChaap.cat.ina.atg..core.ApplicationDispatcher.invoke (ApplicationDispatcher.java:728) в org.apache.catalina.core.ApplicationDispatcher.processRequest (ApplicationDispatcher.java:470) в org.apache.catalina.core.ApplicationDispatcher.doForward (ApplicationDispatcher.java:395) в org.apache.catalina.core.ApplicationDispatcher.forward (ApplicationDispatcher.java:316) в org.springframework.we.servlet.view.InternalResourceView.renderMergedOutputModel (InternalResourceView.java:168) в org.springframework.web.servlet.view.AbstractView.render (AbstractView.java:303) в org.springframework.web.servlet.DispatcherServlet.java: 1271) в org.springframework.web.servlet.DispatcherServlet.processDispatchResult (DispatcherServlet.java:1037) вorg.springframework.web.servlet.DispatcherServlet.doDispatch (DispatcherServlet.java:980) в org.springframework.web.servlet.DispatcherServlet.doService (DispatcherServlet.java:897) в org.springFrameworkServlet.java:970) в org.springframework.web.servlet.FrameworkServlet.doGet (FrameworkServlet.java:861) в javax.servlet.http.HttpServlet.service (HttpServlet.java:635) на org.s.FrameworkServlet.service (FrameworkServlet.java:846) в javax.servlet.http.HttpServlet.service (HttpServlet.java:742) в org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (Application) Filter (Application) Filter.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:166) в org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal (HiddenHttpMethodFilterJava: 107) в org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:193) по адресу org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:166) по адресу org.apache.tomcat.websocket.server.WilF (())в org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:193) в org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:166) в org.apc.(StandardWrapperValve.java:198) в org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:96) в org.apache.catalina.authenticator.AuthenticatorBase.invoke (AuthenticatorBase.jap.6):catalina.core.StandardHostValve.invoke (StandardHostValve.java:140) в org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:81) в org.apache.catalina.valves.AbjAveLogalveal ().650) на org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:87) в org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:342) в org.apache.coyote.http11.Http11Processor.service (Http11Processor.java:80apache) или org.coyote.AbstractProcessorLight.process (AbstractProcessorLight.java:66) в org.apache.coyote.AbstractProtocol $ ConnectionHandler.process (AbstractProtocol.java:790) в org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.dopointun.java: 1468) в org.apache.tomcat.util.net.SocketProcessorBase.run (SocketProcessorBase.java:49) в java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149) в java.util.cThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:624) в org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run (TaskThread.java:61) в java.lang.Thread.run (Thread.java:748)
10 июня 2018 г., 13:46:55. Org.apache.catalina.core.StandardWrapperValve вызывает SEVERE: Servlet.service () для сервлета [dispatcher] в контексте с путем [/ eposh] threw исключение [java.lang.IllegalStateException: ни BindingResult, ни простой целевой объект для имени компонента 'update' не доступны в качестве атрибута запроса] с первопричиной java.lang.IllegalStateException: ни BindingResult, ни простой целевой объект для имени бина 'update' не доступны в качестве запросаатрибут в org.springframework.web.servlet.support.BindStatus. (BindStatus.java:144) в org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus (AbstractDataBoundFormElement.web.rag.tb).servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath (AbstractDataBoundFormElementTag.java:188) в org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getName (AbstractDataB)в org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.autogenerateId (AbstractDataBoundFormElementTag.java:141) в org.springframework.web.servlet.tags.form.AbstractDataBound.rag.web.servlet..tags.form.InputTag.writeTagContent (InputTag.java:142) в org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal (AbstractFormTag.java:84) в org.springframework.web.RequareAtegs.teg.«5fTemplate_jsp._jspx_meth_form_005fform_005f0 (Manage_005fTemplate_jsp.java:924) при org.apache.jsp.WEB_002dINF.views.Manage_005fTemplate_jsp._jspService (Manage_005fTemplate_jsp.java:714) при org.apache.jasper.runtime.HttpJspBase.service (HttpJspBase.java:70)в javax.servlet.http.HttpServlet.service (HttpServlet.java:742) в org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:443) в org.apache.jasper.servlet.Serlet.Serlet.Serlet.Serlet.Serlet.Serlet.Serlet.Serlet.JSerlet.JSerlet.JSerlet.JSerlet.JS.java: 386) в org.apache.jasper.servlet.JspServlet.service (JspServlet.java:330) в javax.servlet.http.HttpServlet.service (HttpServlet.java:742) в org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:231) в org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:166) в org.apache.tomcat.websocket.server.Wsilter (WFF) (WFF)в org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:193) в org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:166) в org.apache.catalina.core.ApplicationDispatcher.invoke (ApplicationDispatcher.java:728) в org.apache.catalina.core.ApplicationDisquer.ApplicationDispatcher.pro470) в org.apache.catalina.core.ApplicationDispatcher.doForward (ApplicationDispatcher.java:395) в org.apache.catalina.core.ApplicationDispatcher.forward (ApplicationDispatcher.java:316) в org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel (InternalResourceView.java:168) по адресу org.springframework.web.servlet.view.AbstractView.render (AbstractView.java:303) по адресу org.springframework.web.servlet.DispatcherServlet.ava.render ().doService (диспетчерыervlet.java:897) по адресу org.springframework.web.servlet.FrameworkServlet.processRequest (FrameworkServlet.java:970) по адресу org.springframework.web.servlet.FrameworkServlet.doGet (FrameworkServlet.javttht at at)..HttpServlet.service (HttpServlet.java:635) в org.springframework.web.servlet.FrameworkServlet.service (FrameworkServlet.java:846) в javax.servlet.http.HttpServlet.service (Http:er.apache.catalina.core.Ява: 81) вorg.springframework.web.filter.OncePerRequestFilter.doFilter (OncePerRequestFilter.java:107) в org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:19apilFalterFactor.AFF) в orgApplicationFilterChain.java:166) в org.apache.tomcat.websocket.server.WsFilter.doFilter (WsFilter.java:52) в org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChaap.g): org.catalina.core.: 96) в org.apache.catalina.authenticator.AuthenticatorBase.invoke (AuthenticatorBase.java:496) в org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:140) в org.apache.catalina.ErrorReportValve.invoke (ErrorReportValve.java:81) в org.apache.catalina.valves.AbstractAccessLogValve.invoke (AbstractAccessLogValve.java:650) в org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:87) в org.apache.catalina.connector.CooteAdjj.) в org.apache.coyote.http11.Http11Processor.service (Http11Processor.java:803) в org.apache.coyote.AbstractProcessorLight.process (AbstractProcessorLight.java:66) в org.apache.coyote.AbstractPropro $ СоединениеAbstractProtocol.java:790) в org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.doRun (NioEndpoint.java:1468) в org.apache.tomcat.util.net.SocketProcessorBase.run (SocketProcessorBase.java:49)в java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149) в java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:624) в org.apache.treadcatTra.run (TaskThread.java:61) на java.lang.Thread.run (Thread.java:748)
my Controller.java
@RequestMapping(value = "/update/{id}", method = RequestMethod.GET)
public String editTemplate(@PathVariable int id, HttpServletRequest request, HttpServletResponse reponse) {
System.out.println("get by id" + id);
ModelAndView model = new ModelAndView("Manage_Template");
model.addObject("update", ts.getTemplateById(id));
/*model.addAttribute("update", ts.getTemplateById(id));*/
return "Manage_Template";
}
Мой JSP:
<div class="modal fade" id="myModal1" role="dialog">
<div class="modal-dialog" style="width:80%;">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Update Template</h4>
</div>
<div class="modal-body">
<div class="box box-warning">
<div class="box-header">
</div>
<div class="box-body">
<form:form role="form" action="" method="post" id="update_form" commandName="update" modelAttribute="update">
<section class="col-lg-12">
<div class="form-group">
<form:input path="template_name" class="form-control" placeholder="Name Of Template" name="template_name" />
</div>
</section>
<section class="col-lg-12">
<form:textarea id="editor1" rows="10" cols="80" path="summary" placeholder="Place some text here" name="summary" />
<!-- </textarea> -->
</section><br>
<div class="form-group">
<input type="submit" class="form-control btn btn-primary" value="Update Template" id="update_template_id">
</div>
</form:form>
</div>
</div>
</div>
</div>
</div>
<!---- in this JSP I am getting error -->
<td><button onclick="editTemplate(<%=rs.getString(1)%>)" data-target="#myModal1" data-toggle="modal" title="Edit" class="btn btn-success btn-sm"><i class="fa fa-edit"></i>Edit</button></td>
<script>
function editTemplate(id) {
$.get("update/" + id, function(result) {
/* $("#myModal1").modal('show') */
});
}
</script>
</div>