Spring Boot jar into existing Spring Project - spring-mvc

We have an existing Spring MVC based application. I was asked to plug-in a customization/utility to this project. I am not supposed to do any changes to the existing application.
For the new utility, I thought of doing it through a Spring boot jar. I created a Spring boot jar and placed in the lib folder of the existing application. However, I am facing few issues with this approach and wanted to know if this is the correct approach and if there are any suggestions out there. The issues are:
The logging level of the Spring boot affects the logging level of the existing application. How can I avoid that?
The Spring MVC application and the Spring boot jar both are based on different versions of Spring. What if there are some common class files or packages in both Spring MVC application and the Spring boot jar but with different versions? Will this create any conflicts or will it affect the functionality? I don't want my Spring boot jar to affect the functionality/logging of the existing application. I just want the Spring boot jar to work whenever it is being called explicitly.
For logging issue, I have tried to use something like below in application.properties file but the issue with that is that those settings are considered only if you run the application through #SpringBootApplication main class. But if you just want to package your functionality in a jar file then the application.properties file is not considered.
logging.level.org.springframework = OFF

Related

Struts migration to Spring MVC - via Spring Boot

We are in the initial stages of converting a Struts 1.2.9 application to Spring MVC. While the impact has been analyzed and well documented and understood for this migration, we are uncertain if we should introduce Spring Boot in this equation.
I have been reading other threads and would like to state that we are not looking to integrate Struts with Spring - rather we are for sure migrating and moving out of Struts to Spring MVC.
Given this background, invite suggestions/thoughts around below:
Benefit of introducing Spring Boot in this process is more of a distant one of an eventual move to Cloud. As such the team has completed the initial configuration required for a Spring application (like web.xml, required jars, spring-servlet.xml) and not sure of immediate benefits for us.
In case we decide to use Spring Boot in this process, we perceive the impact to be:
i. Add spring-boot-starter-web to our gradle build.
ii. Create a starter Application class
iii. Revisit configurations in web.xml like startup servlets using 'SpringBootServletInitializer'
iv. Continue to use a war based traditional deployment using gradle war plugin. Does this package the spring based libraries into the war or should the libraries be on the server classpath?
I welcome thoughts/suggestions/rejections of this as an approach itself :).

STS & Spring Integration multiple xml files and merged Integration Graph

I am working on a project using spring integration. I am using XML because I like the visualization of integration flow using Integration-Graph in STS. But because of reusing components and reorganisation flows in subflows in separate xml files, I would like to have a merged view in the graph.
As I remember the Spring Bean Graph it was possible to select configuration files as package for visualisations.
Is there a functionality for Integration, too?
While that feature is not available in STS, we are working on a runtime visualization of a running Spring Integration application. Since 4.3, Spring Integration (when running in a web container or as a Spring Boot application with web support), can expose the runtime environment as JSON see documentation here.
The spring-flo project has a sample (it's still a work-in-process) for visualizing the flow.
The application used in the readme is the the file-split-ftp sample application. Notice the required CORS bean definition (which will be made simpler in the next release).

Spring Data Rest/HATEOAS without Spring Boot/MVC

Is it possible to use Spring Data Rest/HATEOAS without Spring Boot, Spring MVC on an persistence storage based application. If so how can this be done?
The short answer is Yes. This has been around even before Spring Boot.
The important thing is to ensure the API jars are on your classpath. Get the latest release of Hateoas here and latest release of Spring Data JPA here and add to the classpath. Just pick from the setup you are using (e.g., Maven, Gradle).

Model from a different project in spring mvc

I'm new to spring mvc and I'm trying to add a model I created in a different project from my web project(where I keep the configuration and the controllers).
When I say "use" this models I mean as a return value or as an input parameter from one of my controller's methods. If I use those models as a variable inside of the methods there is no problem.
The web project compiles and everything is good but when I restart Tomcat I see in the logs that he doesn't recognize the models from the other project(if they are in the web project then it's all good).
Any suggestions?
Never mind... All I needed to do it to add the external project to the web's Deployment Assembly and not only to the Java Build Path.
Thanks!

How can I add webflow using Spring Boot and Thymeleaf?

I have written a Spring web app for baseball umpires using Spring Boot and Thymeleaf. I like Spring Boot because it resolves dependency w/o a lot of configuration. Now I want to add Sprng WebFlow so umpires can order uniforms, a typical "shopping cart" application. There are many examples on the web but none using Spring Boot. They all are the traditional xml config with jsp and jstl. Has anyone used Spring Boot and WebFlow? There are WebFlow examples on the official Spring web site but very complicated. Thanks Rob
Spring Roo 2.0.0.M3 generates Spring Boot applications and integrates Spring Web Flow easier than ever.
The reference guide includes detailed descriptions of all the features, plus an extensive user guide for main use cases.

Resources