-
0 votesanswersviews
Thymeleaf和静态内容
我正在开发一个Spring Boot项目,其中Thymeleaf被用作模板引擎 . 我正在为这个项目设置Swagger,所以我希望能够在我的Thymeleaf内容中提供静态内容 . “example.com/help”应该返回一个模板 . “example.com/docs”应返回静态内容 . 目前这个: @RequestMapping("/docs") public ... -
2 votesanswersviews
Spring-mvc Thymeleaf:处理复杂的形式
我正在使用spring-mvc和thymeleaf开发内部工具 . 此工具的一部分用于创建我们保存在数据库中的实体 . 这个实体非常复杂;它包含许多属性和关系 . 其中一些关系包含列表和其他属性 . 我有2个限制: 单页 . 没有"wizard" . 仅保存数据库中已完成的对象 . 现在,我并没有真正要求具体问题 . 我知道我的方式绕着百里香, Spring 天@M... -
2 votesanswersviews
如何从表单中选择集合中的实体? Spring MVC和Thymeleaf
Company 在 Set 中有一些 User 实体,所有用户都存储在DB中 . 我想以HTML格式选择一些使用 multiple-select 的用户 . 使用Thymeleaf和Spring(MVC,Boot) . 我_752502已经尝试过@InitBinder,Spring Core Converter,但没有任何效果 . 问题: @Controller failes on binding... -
0 votesanswersviews
在Spring中使用Map进行绑定 - Thymeleaf
我可以使用spring MVC将字段绑定到thymeleaf中的Map . 例如,考虑这个例子 . 假设我有一个像这样的简单命令对象 @Data public class SampleCommand { @Email(message = "{invalidEmail}") private String email; private String passwo... -
0 votesanswersviews
Spring MVC Thymeleaf:通过页面传递对象
我正在使用spring MVC和thymeleaf开发一个简单的Web应用程序 . 我的控制器中有一个由此方法正确处理的表单 @RequestMapping(value = "/list", method = RequestMethod.POST) public ModelAndView searchJob( @ModelAttribute(SEARCH_PAR... -
1 votesanswersviews
如何访问Thymeleaf中包含点的Spring MVC模型属性名称
好吧,既然Spring Boot框架推荐了Thymeleaf模板引擎,那么我创建了一个使用http://start.spring.io选择 Web 和 Thymeleaf 依赖项的简单项目 . 由于以下 HomeController 和 home/about.html 模板工作正常 . 这是 HomeController 的java源代码: import org.springframework.s... -
0 votesanswersviews
带有Thymeleaf的复选框和Spring MVC中的自定义列表对象(引导)
我正在使用Thymeleaf和Spring Boot以及MVC . 我所拥有的是一个表单,其中某些复选框正在填充从控制器添加到模型中的对象(q1) 我想知道的是,如何正确地使用Thymeleaf将所选复选框与我的结果对象(surveyData)绑定到(复杂)对象列表中 . Edit 这也是我第一次不确定问题出在何处 . 我确实尝试调试 lot 但无法确定问题的确切位置 . 我尝试了各种不同的组合来... -
0 votesanswersviews
使用spring mvc处理百里香的一对多关系
我有一个实体作为供应商,另一个实体作为地址,它们之间的关系是一对多形式供应商要解决 . 注意:我正在使用JPA 我的供应商实体 public class Vendor { private Integer id; private String name; private List<Address> address; // getter and setters } ... -
0 votesanswersviews
如何将形式分割成百里香叶片?
在我的spring-mvc项目中,两个JPA实体具有不同名称的Organization属性: @Entity public class Video extends AbstractIdentifiable implements Serializable { @ManyToOne @JsonIgnore @JoinColumn(nullable = false) pr... -
8 votesanswersviews
如何在使用Spring Boot时使用SpringTemplateEngine
我正在使用Thymeleaf SpringTemplateEngine在我的Spring应用程序上创建HTML电子邮件 . 当我使用纯Spring MVC时,一切都很完美 . 现在使用Spring Boot,类无法找到我的.html模板 . 我认为问题在于ServletContext没有返回正确的路径,但我无法弄清楚如何解决它 . 那么我应该使用另一个Context来处理模板吗?哪一个? 这是我的... -
0 votesanswersviews
强制 spring 启动(thymeleaf)返回字符串作为明文而不是模板的名称
我有像this guy一样的错误,但解决方案无效 . 虽然我们使用百里香,我们也有一些函数返回字符串,不应该被解释为视图名称 . 我的方法返回一个字符串,控制器用 @RestController 注释,方法如下所示: @ResponseBody @RequestMapping(value = "/register/{phoneNumber}", method = Request... -
0 votesanswersviews
Thymeleaf和JSP解析器在一个Spring MVC应用程序中
我有一个带有Thymeleaf视图解析器的Spring MVC应用程序 . 这是我的配置类: public class WebConfig extends WebMvcConfigurerAdapter { @Bean public SpringResourceTemplateResolver springResourceTemplateResolver() { ... -
2 votesanswersviews
使用XML模板的Spring Boot和Thymeleaf
我有一个带有控制器的Spring Boot应用程序,它返回一个ModelAndView和Thymeleaf来渲染模板,模板位于/src/main/resources/templates/*.html 这工作正常,但我如何配置Spring和/或Thymeleaf来查找xml文件而不是html? 如果它有帮助,我正在使用Gradle和org.springframework.boot:spring-bo... -
2 votesanswersviews
使用Thymeleaf页面布局
我正在尝试在我当前的spring-boot项目中使用百万美元页面布局 . 我将其添加到我的index.html视图(放在resources / templates / public中): <nav class="navbar navbar-default navbar-fixed-top"> <div th:include="menu :: me... -
0 votesanswersviews
我的Spring Boot应用程序无法看到Thymeleaf模板
我有一个Spring Boot应用程序,我用这些行在pom.xml中定义了我的百万美元依赖项: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactI... -
1 votesanswersviews
如何添加对多个Thymeleaf模板模式的支持
我有一个Spring Boot应用程序,使用Thymeleaf 3作为应用程序页面的模板引擎 . 我们使用spring-boot-starter-thymeleaf提供的默认配置,以及src / main / resources / templates文件夹下的HTML Thymeleaf模板 . 现在我们想使用Thymeleaf生成一些javascript文件,使用新的javascript模板模... -
1 votesanswersviews
Spring Boot的org.thymeleaf.exceptions.TemplateInputException
我使用带有百叶窗的Spring Boot,但百万美元不像'org.thymeleaf.exceptions.TemplateInputException:解析模板“毕业”时出错,模板可能不存在或任何配置的模板解析器都无法访问 这是例外,当我访问'localhost:8080' org.thymeleaf.exceptions.TemplateInputException: Error resolv... -
3 votesanswersviews
在thymeleaf spring boot templates子文件夹中查看
我在 Spring 季靴子里使用百里香,并有几个看法 . 我不希望将所有视图保留在默认情况下src / main / resources / templates的同一文件夹中 . 是否可以在src / main / resources / templates / folder1中移动一些视图,我将传递“folder1 / viewname”来访问该页面? 当我尝试http://localhost:... -
1 votesanswersviews
使用Spring Boot Thymeleaf不要作为Web应用程序运行
我有一个Spring Boot应用程序,它使用Thymeleaf进行电子邮件模板化 . 我的应用程序不是Web应用程序 . 但是,当包括 spring 靴启动器百里叶依赖时: compile('org.springframework.boot:spring-boot-starter-thymeleaf') Spring MVC是传递性的,并且最终在我的类路径中包含Servlet.class,表明我... -
2 votesanswersviews
Spring 靴和百里香
我使用spring boot 1.5.6 release和thymeleaf 3.0.0.release,thymeleaf-layout-dialect 2.0.0 . 我写了一个html文件,如下所示 . header_top和footer_bottom是另外两个html文件,内容是: 我有一个控制器,很简单: 启动应用程序如下: the applications.properties... -
0 votesanswersviews
Spring Boot Thymeleaf:无法解析Spring EL表达式
我正在使用spring boot thymeleaf neo4j . 一切都运行正常,除了百里香叶无法解析模板product_grid.html中每个块中使用的'product'变量的一些属性,其中包括:src = "$",th:text = "$"和th:action = "@{/product/(${Product.getId()})}&quo... -
23 votesanswersviews
具有Spring Security的Thymeleaf - 如何检查用户是否已登录?
我正在使用带有Thymeleaf和Spring Security的Spring Boot . 我有一个带登录链接的简单视图 . 当用户登录时,我想将登录链接更改为注销链接 . 我试过了: <div sec:authorize="#{isAuthenticated()}"> <a th:href="@{/logout}">Log o... -
1 votesanswersviews
Thymeleaf Security不适用于Spring Boot 1.3.5
我试图让我的Web应用程序再次使用新的Spring Boot版本1.3.5,但是百日咳方言似乎不再起作用了 . 我补充道 <dependency> <groupId>org.thymeleaf.extras</groupId> <artifactId>thymeleaf-extras-springsecurity4</artif... -
1 votesanswersviews
Value 如何在百里香叶和 spring 控制器之间转移,反之亦然
我是百老汇的新手......有人可以告诉你百事可乐和 spring 控制器之间的 Value 观是如何传递的......请为thymeleaf-spring-mvc建议好的教程...... 在下面的示例中,请让我知道用户在文本字段中输入所有者的值是如何传递给spring控制器的,以便验证并返回结果 . 反之,控制器返回的结果如何由百万美元来显示结果 . 如何控制器知道LASTNAME的值..如何将... -
1 votesanswersviews
使用Spring-Boot和Thymeleaf编辑表数据
我还在学习Thymeleaf,Bootstrap和JQuery,所以请原谅我的无知 . 我有一个以Thymeleaf和Bootstrap作为UI的spring-boot应用程序 . 我有一个用户列表,我在表格中显示并想要编辑它们 . 我目前的想法是,用户可以选择行上的图标,并将该记录填充到模式对话框中,可以通过调用进行更新 . 不确定这是不是最好,但它就是我现在的位置 . 这是我的HTML: &l... -
1 votesanswersviews
Spring和Thymeleaf:从th:each table向控制器发送一个对象
我正在使用带有 Thymeleaf 的 th:each 属性创建经验数据表,我的目标是在每一行中都有一个提交按钮,当单击时,会向我的控制器发送一个体验对象,该对象与我单击提交按钮的行相对应 . 我不知道什么是错的,似乎无法在网上找到任何帮助解决这个问题 . 这是我的网页代码部分: <div th:unless="${#lists.isEmpty(borrower.experienc... -
3 votesanswersviews
我可以在Spring Boot应用程序中从Thymeleaf表发出HTTP POST请求
我在一个简单的Spring Boot应用程序中有一个Thymeleaf模板 . 该模板在表中包含一个列表,如下所示: <p>There are <span th:text="${#lists.size(persons)}"></span> people:</p> <table th:if="${not #lists... -
0 votesanswersviews
使用thymeleaf从HTML向Spring控制器发送多行数据(表)
我正在使用html,thymeleaf,Spring MVC进行应用程序,我想将表数据发送到spring控制器,但是当我点击应用程序的save按钮时,在控制台上出现错误: java.lang.IllegalStateException:在org.thymeleaf org.springframework.web.servlet.support.BindStatus . (BindStatus.j... -
1 votesanswersviews
没有调用[复制]的百里香叶法 spring 启动
这个问题在这里已有答案: Trailing slash is not inserted in Spring Boot application 1回答 我试图用按钮单击使用表单操作调用一个带有post贴图的java方法,我尝试了很多,不幸的是,该方法没有调用,令我震惊的是,几乎相同的代码在其他项目中工作得非常好 . 这是控制器类: @Controller @RequestMapping(&quo... -
0 votesanswersviews
Thymeleaf标签不向服务器返回值
我发现当数据最初从控制器层传入时,很难从网页中检索数据 . 我正在使用Thymeleaf 3和Spring boot v1 . 我有一个webMVC控制器,它将对象传递给模板 . 该对象看起来像这样(伪代码): public class Person{ // Nested object retrieved from various data sources // and passed ...