我成功运行了以下示例(简单的Spring Web应用程序): https://www.youtube.com/watch?v=GTrNkhVnJBU
现在我想在一个基于Spring Boot和Vaadin TouchKit的项目中使用Spring Loaded。
当我进行更改时(例如,ComboBox的新标题),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刷新浏览器后,我看不到更改(ComboBox的标题与以前保持一致)。
我错过了什么吗?在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应用程序中没有更新。
答案 0 :(得分:1)
我在https://github.com/Artur-/spring-boot-loaded-vaadin
创建了一个带Spring Boot + Spring Loaded + Vaadin的简单示例项目使用mvn install spring-boot:run运行它,您可以更改UI类并在刷新后查看更改。
我看不出TouchKit会改变什么,除非你的UI类上有@PreserveOnRefresh。在这种情况下,除了刷新之外,您还需要强制创建一个新的UI实例,方法是将“restartApplication”添加到URL中。