gpt4 book ai didi

java - 如何将 Spring Loaded 与 Vaadin TouchKit 应用程序结合起来?

转载 作者:行者123 更新时间:2023-12-01 11:11:02 25 4
gpt4 key购买 nike

我成功运行了以下示例(简单的 Spring Web 应用程序): https://www.youtube.com/watch?v=GTrNkhVnJBU

现在我想在一个基于 Spring Boot 和 Vaadin TouchKit 的项目中使用 Spring Loaded。

当我进行更改时(例如组合框的新标题),Spring Loaded 似乎可以识别它:

2015-09-03 10:23:08.823  INFO 1956 --- [Loader@799dbc3b] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2015-09-03 10:23:08.823 INFO 1956 --- [Loader@799dbc3b] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)
2015-09-03 10:23:08.831 INFO 1956 --- [Loader@799dbc3b] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2015-09-03 10:23:08.831 INFO 1956 --- [Loader@799dbc3b] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)
2015-09-03 10:23:08.842 INFO 1956 --- [Loader@799dbc3b] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2015-09-03 10:23:08.843 INFO 1956 --- [Loader@799dbc3b] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)
2015-09-03 10:23:08.870 INFO 1956 --- [Loader@799dbc3b] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2015-09-03 10:23:08.870 INFO 1956 --- [Loader@799dbc3b] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)

但是按 F5 刷新浏览器后,我没有看到任何变化(组合框的标题与以前相同)。

我错过了什么吗?在 Spring Loaded 与 Vaadin TouchKit 配合使用之前我还需要做其他事情吗?

感谢您的阅读以及您提前获得的任何提示!

编辑:

当我在简单的 Spring Web 应用程序示例中进行更改时,我得到以下日志输出:

2015-09-03 10:51:06.503  INFO 8388 --- [Loader@14dad5dc] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/]}" onto java.lang.String ???.???.tests.springloaded.SpringLoadedController.home()
2015-09-03 10:51:06.504 INFO 8388 --- [Loader@14dad5dc] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error]}" onto public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>> org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
2015-09-03 10:51:06.504 INFO 8388 --- [Loader@14dad5dc] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped "{[/error],produces=[text/html]}" onto public org.springframework.web.servlet.ModelAndView org.springframework.boot.autoconfigure.web.BasicErrorController.errorHtml(javax.servlet.http.HttpServletRequest)

因此上下文“/”似乎在那里更新,但在 TouchKit 应用程序中没有更新。

最佳答案

我使用 Spring Boot + Spring Loaded + Vaadin 创建了一个简单的示例项目,地址为 https://github.com/Artur-/spring-boot-loaded-vaadin

使用 mvn install spring-boot:run 运行它,您可以更改 UI 类并在刷新后查看更改。

我看不出 TouchKit 会改变什么,除非你的 UI 类上有@PreserveOnRefresh。在这种情况下,除了刷新之外,您还需要通过在 URL 中添加 ?restartApplication 来强制创建新的 UI 实例。

关于java - 如何将 Spring Loaded 与 Vaadin TouchKit 应用程序结合起来?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32370743/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com