how to use web.xml file into spring boot application without extend WsConfigurerAdapter? - spring

I am using spring-boot to develop webservices, but I don't want to use WsConfigurerAdapter to define a WSDL and all, because I want to deploy my war into WAS7 and it does not support Servlet 3.0. So how would I add a web.xml configuration into my application.

Spring Boot doesn't support Servlet 2.5 out of the box, however you can use Spring Boot Legacy to get things working. Take a look at the Google App Engine sample application for an example of how to use Spring Boot Legacy and web.xml.
You may also be interested in this Spring Boot issue which is proposing to make Spring Boot Legacy an official part of Spring Boot.

Related

Is there a way I can integrate the spring boot application jar to another servlet application?

I have created a spring boot application with a few endpoints and want to make that endpoint to the existing servlet application without deploying it separately. So I want to create a jar from the spring boot app and use that jar in the servlet project. How can this be done? Any suggestion would be really helpful.

Add a RESTful API using Spring Boot to an existing webapp running on Tomcat

I would like to add a RESTful API using Spring Boot to an existing webapp running on Tomcat. I have tried to use the SpringBootServletInitializer in order simplify the integration. However, when doing so Spring Boot seems to interfere with the existing webapp (e.g., / doesn't work as it used to any more).
Is it possible somehow to configure the Spring Boot integration so that it only handles endpoints that starts with /api and ignores everything else?
Also, is it possible to use the SpringBootServletInitializer for this?
The existing servlets are registered with servlet-mappings using the web.xml file.

Spring Boot Confusion (using spring cloud dependency in spring boot framework)

I am new to spring framework. I have a confusion regarding spring boot and spring cloud.
I used https://start.spring.io/ to initialize a spring boot application. I think I am using the spring boot framework. However, I would like to use some spring cloud dependencies such as spring-cloud-stream-binder-kafka.
Question 1: If I added this dependency above to my spring boot application, I am wondering if I still can go with the spring boot framework, or I have to change to spring cloud framework.
Question 2: I am wondering if there is any difference when deploying the spring boot or spring cloud application. Or, they just have the different frameworks, and we could deploy them in the same way.
Thank you so much!
You can use together Spring Boot and Spring Cloud packages.
Spring Boot is just a preconfigured Spring Framework with some extra functionalities. It also uses library versions compatibile with each other. Spring Cloud is also the part of the Spring ecosystem, contains libraries that mostly used in cloud applications.
In the background, these packages will pull all necessary Spring (and other) libraries into your project, as transitive dependencies.
So you can use the generated pom/gradle, and add other dependencies. In this case Spring boot will be your core and cloud add extras.

Spring boot for legacy Struts application

I have come across couple of discussions here about Spring Boot setup for Struts application but did not get a valid yes or no.
I know we can migrate the struts to spring and then use it with Spring boot but considering the timelines and application complexity we need to just migrate from Legacy Websphere to Spring boot for the Struts application.
Can we integrate spring boot with a legacy Struts 1.x application ?
P.S:
So far I am able to start up tomcat for spring boot successfully for my war but I do get 404 on browser so need to understand what would be the flow after the request flow to Main class.

Spring Boot Actuator in the traditional container

Can we use the Spring Boot Actuator in the traditional shared container within the context of an application? If so, how would be the configuration look like?
I have tried it by bootstrapping EndpointWebMvcAutoConfiguration. However, could not map mvc urls.
There's nothing stopping you from just using it as a dependency. Any Spring Boot app should be able to use actuator features out of the box.

Resources