当前位置: 首页 > 知识库问答 >
问题:

执行处理器'org.Thymeleaf.spring5.processor.SpringInputGeneralFieldTagProcessor'时出错

沈弘文
2023-03-14
  <form class="form-inline" action="#"  th:action="@{/search}" modelAttribute="sInput" th:object="${sInput}" method="post">
                <input class="form-control mr-sm-2" type="text" placeholder="Search" th:field="*{keyWord}">
                <input type="submit" value="Submit" />
      <!--      <button class="btn btn-success" type="Submit" value="Submit">Search</button> -->
            </form>
 @GetMapping(value="/search")
    public String SearchForm(Model model) {

         SearchInput sInput = new SearchInput();
        model.addAttribute("sInput",sInput);

        return "scCountry";
    }

    @PostMapping(value="/search")
    public String SearchResult(@ModelAttribute("sInput") SearchInput sInput, BindingResult bindingResult, Model model) {
        if (bindingResult.hasErrors()) {
            return "scCountry";
        }

        SearchVO searchVO = null;
        try {
            searchVO = webServices.searchAll(sInput.getKeyWord());
        } catch (TwitterException e) {
            e.printStackTrace();
        }

        model.addAttribute("searchVO",searchVO);

        return "scSearch";
    }
public class SearchInput {

    private String keyWord;
    public String getKeyWord() {
        return keyWord;
    }
    public void setKeyWord(String keyWord) {
        this.keyWord = keyWord;
    }
    public SearchInput() {
    }
    public SearchInput(String keyWord) {
        this.keyWord = keyWord;
    }
}

原木

         :[Ljava.lang.Byte;@3929bes             :[Ljava.lang.Byte;@1995b82018-12-13 20:45:53.989 ERROR 6400 --- [nio-8080-exec-1] org.thymeleaf.TemplateEngine             : [THYMELEAF][http-nio-8080-exec-1] Exception processing template "scCountry": Error during execution of processor 'org.thymeleaf.spring5.processor.SpringInputGeneralFieldTagProcessor' (template: "scCountry" - line 31, col 86)

templateProcessingException:在org.thymeleaf.processor.element.abstractAttributeTrocessor.doProcess(abstractAttributeTrocessor.java:117)~[thymeleaf-3.0.9.release.jar:3.0.9.release]在org.thymeleaf.process.java:95)~[thymeleaf-3.0.9.release.jar:3.0.9.release.jar:3.0.9.release]在org.thymeleaf util.processorConfigurationUtils$elementTagProcessorWrapper.process(ProcessorConfigurationUtils.java:633)~[ThymeleaF-3.0.9.release.jar:3.0.9.发布]在org.Thymeleaf.engine.processorTemplateHandler.handleStandalOneElement(ProcessorTemplateHandler.java:918)~[ThymeleaF-3.0.9.release]在org.Thymeleaf.Engine.StandalOneElement在Odel.process(TemplateModel.java:136)~[Thymeleaf-3.0.9.release.jar:3.0.9.发布]在org.Thymeleaf.engine.TemplateManager.parseandProcess(TemplateManager.java:661)~[Thymeleaf-3.0.9.release.jar:3.0.9.发布]在org.Thymeleaf.templateEngine.process(TemplateEngine.java:1098)[Thymeleaf-3.0.9.发布]在meleaf.spring5.view.thymeleafview.renderfragment(thymeleafview.java:354)[thymeleaf-spring5-3.0.9.release.jar:3.0.9.release]在org.apache.coyote.http11.http11processor.service(http11processor.java:803)[tomcat-embed-core-8.5.31.jar:8.5.31]在Java:790)[tomcat-embed-core-8.5.31.jar:8.5.31]at org.apache.tomcat.util.net.nioendpoint$socketprocessor.dorun(NioEndpoint.java:1468)[tomcat-embed-core-8.5.31.jar:8.5.31]在org.apache.tomcat.util.net.socketprocessorbase.run(socketprocessorbase.java:49)[tomcat-embed-core-8.5.31.jar:8.5.31]在java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1142)[na:1.8.0_121]在s.taskthread$wrappingrunnable.run(taskthread.java:61)[tomcat-embed-core-8.5.31.jar:8.5.31]在java.lang.thread.run(thread.java:745)[na:1.8.0_121]由:java.lang.thread.run(thread.java:745)[na:1.8.0_121]引起:java.lang.IllegalStateException:bean name的input既没有BindingResult也没有纯目标对象作为request属性在dStatus(requestcontext.java:903)~[spring-webmvc-5.0.7.release.jar:5.0.7.release]位于org.thymeleaf.spring5.context.webmvc.springwebmvcThymeleAfRequestContext.getBindStatus(SpringwebmvcThymeleAfRequestContext.java:227)~[Thymeleaf-Spring5-3.0.9.release.jar:3.0.9.release]在org.Thymeleaf.spring5.util.FieldUtils.GetBindStatusFromParsedExpression(FieldUtils.java:305)~[Thymeleaf-Spring5-3.0.9.release.jar:3.0.9.AR:3.0.9.发布]在org.Thymeleaf.spring5.util.FieldUtils.getBindStatus(FieldUtils.java:226)~[Thymeleaf-Spring5-3.0.9.release.jar:3.0.9.发布]在org.Thymeleaf.spring5.processor.AbstractSpringFieldTagProcessor.doProcess(AbstractSpringFieldTagProcessor.java:174)~[Thymeleaf-Spring5-3.0.9.Release.jar:3.0.9.发布]在:3.0.9.发布]...56个公共帧省略

2018-12-13 20:45:54.002

(bindstatus.java:153)~[spring-webmvc-5.0.7.release.jar:5.0.7.release]在org.springframework.web.servlet.support.requestContext.getBindStatus(requestContext.java:903)~[spring-webmvc-5.0.7.release.jar:5.0.9.release]在org.thy meleaf.spring5.util.fieldUtils.getBindStatusFromParsedExpression(FieldUtils.java:305)~[Thymeleaf-Spring5-3.0.9.release.jar:3.0.9.发布]在org.Thymeleaf.spring5.util.FieldUtils.getBindStatus(FieldUtils.jav:252)~[Thymeleaf-Spring5-3.0.9.release.jar:3.0.9.发布]在spring5.processor.abstractSpringFieldTagProcessor.doProcess(abstractSpringFieldTagProcessor.java:174)~[ThymeleaF-Spring5-3.0.9.release.jar:3.0.9.release]在org.Thymeleaf.processor.element.abstractAttributeTagProcessor.doProcess(abstractAttributeTagProcessor.java:74)~[Thymeleaf-3.0.9.release.jar:3.0.9.release]在PlateHandler.handleStandalOneElement(processorTemplateHandler.java:918)~[ThymeleAF-3.0.9.release.jar:3.0.9.release]在org.ThymeleAf.engine.StandalOneElementTag.behandle(standalOneElementTag.java:228)~[ThymeleAF-3.0.9.release]在eaf-3.0.9.release.jar:3.0.9.release]

...

我得到了一个错误:bean name的输入“作为请求属性可用”的BindingResult和普通目标对象都没有

我尝试了下面的解决方案,在这个平台中得到了回答:

使用thymeleaf的html表单验证不工作Spring Boot

Thymeleaf注册页-执行处理器'org.Thymeleaf.spring4.processor.attr.SpringInputGeneralFieldatTrProcessor'时出错

<form class="form-inline"   action="/search" method="post">
                <input class="form-control mr-sm-2" type="text"  id="keyWord" name="keyWord" value=""  placeholder="Search" >
                <input type="submit" value="Submit" />
      <!--      <button class="btn btn-success" type="Submit" value="Submit">Search</button> -->
            </form>

有人能帮我吗?

我想知道为什么sccountry.html中的“th:object=”${sInput}“没有在模型中获取我将其放在同名模型中的对象?

共有1个答案

柳业
2023-03-14

也面临着类似的问题。这不起作用:

这是:

 类似资料:
  • Apache NIFI“ExecutesQL处理器”能否以“X”MB为单位流式传输大量的选择结果?

  • 我正在尝试使用Apache Nifi实现下面的工作流: executesql-这是从avro格式的oracle数据库中获取数据 puthdfs-这是将数据放入HDFS executeProcess--这个处理器在后台执行bash脚本,然后创建外部配置单元表

  • 在META-INF/Services中,添加了javax.annotation.processing.processor条目,指定自定义注释处理器类。

  • 我已经升级到Spring靴2,这反过来又更新了执行器。我使用了Spring Boot1.*执行器度量字段“处理器”,如下所示:

  • 我正在寻找测量Spring批处理读取、处理和写入操作的执行时间的最佳方法。在元数据中,有关于整个步骤的信息,而不是关于每个动作的信息。 谢谢你所有的回答!

  • 我对Arduino和Processing都比较陌生,我一直在开发一种利用两者之间串行通信的代码。我的Arduino代码从压电传感器读取并打印数值,然后将数值发送给Processing,Processing根据数值绘制特定形状。该代码以前已经工作过,但由于某种原因,它不再工作。一切都会编译,但当我运行处理代码时,草图窗口是空的,并且仍然是空的。有几次“错误,禁用serialEvent()”出现了,但