I would like to create a Spring Boot application to be deployed on Google AppEngine infrastructure. GAE currently only supports servlet 2.5 web applications.
Is it possible to use Spring Boot - using auto-configuration - in combination with a old-fashioned web.xml?
Can I for example use a contextClass/contextConfigLocation pointing to a #Configration class including #EnableAutoConfiguration?
All Spring Boot examples seem to use a simple Application class with main method to run the application. So I would like to know if Spring Boot supports using a web.xml as start point to boot the application?
More than one question there:
There's nothing stopping you from using web.xml (it's still part of the Servlet spec). Most people prefer the Java initializers these days.
#EnableAutoConfiguration works for any application context (it just uses features of Spring).
But Spring Boot out of the box doesn't have a ContextLoaderListener that knows about SpringApplication, so you miss some of the benefits of Boot if you do as you describe. There's one you might find useful here.
Spring Boot Actuator relies on a few Servlet 3.0 features here and there so you need workarounds for a 2.5 environment (see this spring-boot-legacy prototype for details).
There's a sample app here that runs on GAE, currently deployed here: http://dsyerboot.appspot.com/.
Related
I have a web application NOT implemented on Spring Boot or Spring itself. It has no Spring whatsoever, it was made using RESTEasy running on Tomcat.
I'm supposed to add ADFS authentication to this web application through the use of Spring's Security SAML Extension.
I've seen a lot of projects online that implement this feature but all of them use Spring Boot or run on Spring. At the same time I've seen mentions of being able to implement Spring SAML without having a Spring project. So I'm a little confused now.
Is this feat achievable?
If so, could you guide me on how to do it?
Which Maven dependencies do I need exactly?
Which web.xml configs do I need?
Which Beans do I need to implement?
Thank you in advance.
we have old tomcat application in our project. I like to change it to spring boot for easing my development. but I don't know the way. Will someone helps me out, how to do that
Actually they are two different things.
You can have a Tomcat server with Spring Boot framework.
If you want to get this server setted with Spring Boot, just get a look in this link:
https://www.baeldung.com/spring-boot-configure-tomcat
So, I'm trying to migrate a simple struts2 application into spring boot, and I already achieved that by registring the StrutsPrepareAndExecuteFilter as a bean in my Application.java
The problem is that my client wants to migrate a web application from JAVA EE to Spring boot while keeping web.xml because it has many servlets, filters and listeners, and he doesnt want to register them as beans.
So I'm trying to figure out if there is a way to use web.xml configuration in a spring boot application, I have already spent two days googling about that but still no luck..
I want to embed jetty in one of my spring mvc application. I followed the tutorial http://examples.javacodegeeks.com/enterprise-java/jetty/jetty-tutorial-beginners/ (scroll down to embedded jetty part i.e 2.0).
I followed and understood the tutorial but it seems to be working for servlets only whereas in my application I'm having controller methods.
Server server = new Server(7070);
ServletContextHandler handler = new ServletContextHandler(server, "/example");
handler.addServlet(ExampleServlet.class, "/");
server.start();
This code seems to add only a servlet (ExampleServlet.class) in embedded jetty but I want to make it work for my spring mvc application where I'm using #RequestMapping etc for URL information. The question is how to add those controllers in the embedded context handlers. Please let me know what all changes I need to do to embed jetty in my spring mvc application and following most of the part of this tutorial http://examples.javacodegeeks.com/enterprise-java/jetty/jetty-tutorial-beginners/ (scroll down to embedded jetty part)
Manual embedding is obsolete; use Spring Boot instead, which handles all of this for you. Boot offers out-of-the-box starters for Tomcat, Jetty, or Undertow.
I want to use spring's dependency injection for now(other core functionalites later maybe) in tomcat application.
I want to set up spring 2.5.5 in tomcat7, But don't have clarity on how to do this.
Specifically I am confused because I don't know whether to use Spring MVC or use just spring in tomcat.
I found this question helpful: Tomcat with Spring, But still didn't get the whole scenario on how to setup tomcat with spring.
You can do either, using just core spring with tomcat is fine. MVC provides additional functionality.
Take a look at the spring source examples on github, and read their docs.
(BTW I thouroughy spring-MVC component - it really saves time developing webapps)