Deploying a WAR to an application server in Spring Boot

How can we package our application as a WAR file and not a JAR?

In this tutorial, we are taking a look at a student’s question from my Spring Boot Introduction Course. We might not realize it but when we start a new project we are selecting how we want to package this application when we ready to go live. 

Spring Boot: Package as WAR

I recently received the following question from a student: 

In the real world, an application will be deployed to an application server like JBoss. How can the application be wrapped into a war file and deploy to the application server?

Thank you for the question and now let’s dive into the answer. 

Spring Boot Configuration using YAML

In this tutorial, we are going to look at a question from a student in my Spring Boot Introduction course. This question had to do with using a YAML file for configuration and the best way about how to inject a single property for multiple environments. 

Spring Boot YAML Configuration

Let’s take a look at the question and then we will talk through the solution. 

Hi!
How can I access these properties from a single yml properties file in the DataSourceConfig? Thanks.

Building your Angular Application for Spring Boot

How to bundle your Angular application into your next Spring Boot Project

I have been working on a ton of different Angular projects lately and some of them are going to be included in my Angular 4 Java Developers Course

Building Angular for Spring Boot

There might be times when you have one team working on the front end (Angular) and another working on the back end. There are certainly times when it makes sense to separate the tasks for these applications but there are also times when you as a developer wear many hats. Today we are going talk about the scenario where you are working on both the Angular & Spring Boot application side by side. 

Spring Boot Properties: Setting the locale

A question from a student about Internationalization in Spring Boot.

In today’s article, we are going to look at a question from a student in my Spring Boot Introduction course. This question has to do with Internationalization and more specifically how to set the locale in the properties file of a Spring Boot application. 

Spring Boot Internationalization: Setting the locale

This question comes in from Mykhaylo. 

Hi,

I’ve put in my property file spring.mvc.locale=fr , but it is still messages from default messages.properties file that are displayed. 

If I display a value of current locale I see that this is en_GB, and not French:  <p th:text=”${#locale}”>…..</p>

What is the way to set up a locale in SpringBoot?

Spring Boot 2.0 M2 Now Available

The next milestone release of the highly anticipated Spring Boot 2.0 is now available.

A few weeks ago we got our first look at the next major version of Spring Boot. We talked about all kinds of exciting things such as a Java 8 baseline, Spring Framework 5 support and the new Gradle plugin. 

Spring Boot 2.0

In this article, we take a quick look at the next iteration of Spring Boot 2.0, milestone 2. 

Spring Boot Defining @RequestMapping handler methods

@RequestMapping handler methods can have very flexible signatures.

In this article, we are going to take a look at what happens when you define a method that is annotated with @RequestMapping. @RequestMapping is one of the most widely used Spring MVC annotation. RequestMapping annotation is used to map web requests onto specific handler classes and/or handler methods. If you have done any work with Spring MVC you have undoubtedly come across this annotation before. 

@RequstMapping

The reason we are talking about this is that I had a student ask me the following question.

Hi Dan, I’m really enjoying the course so far but there are a few things that don’t quite fit to my head.

In the lesson 43 (Error Handling) we have CustomErrorController  class where we are injecting ErrorAttributes  inside the constructor via @AutoWired  so I assume that Spring boot will initialize that object automatically for us.

Now what about the error()  method? How did the parameters Model model and HttpServletRequest request  came up? Is spring boot going to initialize those objects for us too? (apparently yes cause they just work) But then why @AutoWired  is not needed to automatically inject those objects just like what happens in constructor? 

Furthermore how could I know that I need the above 2 parameters? Could there be any further parameters in the error method that I should be aware of? If yes would they be initialized automagically like Model  and HttpServletRequest ?

Thanks

How to check your version and upgrade JHipster

A quick tutorial on checking and updating your version of JHipster

The last few months of my life have been full of Angular + Spring Boot projects and I have been having a blast. When you start building these types of applications you need to start looking into JHipster. 

Greetings Java Hipster

If you’re new to JHipster I wrote up a tutorial titled “What is JHipster & Why you need to start using it today”. In this short post, we are going to look at how to tell what version of JHipster you’re running and how to tell if there are updates available. If there are updates available you will wanna upgrade to the current version. This is not a tutorial on upgrading a current application from one version to another as there is a little more work involved in that.

The first release of Spring Boot 2.0 is now available!

We have our first available release of what promises to be an awesome release

I have had a lot of fun watching the Spring Boot project grow into an amazing product over the last few years. A month ago I looked at the Spring 2.0 Roadmap and today we get to start walking down that road. 

Spring Boot 2.0

It is so exciting to see all of the new features coming in both Spring Framework 5 and Spring Boot 2.0. In this article, we are going to look at the first milestone release of Spring Boot 2.0. We will talk about how to update your current projects, start a new one and a brief look at the new features. 

Spring Beans @Component vs @Bean

What is the difference between @Component and @Bean.

I received a question from a student in my Spring Boot Introduction course that I would like to share with you. 

Dan uses @Service annotation for the NotificationService to add it to the application context yet the User class doesn’t need any annotation to be added to the class itself.  He just used the @Bean annotation in the SpringBeansApplication class for it to be added to the application context.  Why is that? 

Spring Beans

This is actually something that a lot of people are confused by. In this article, we will look at the difference between @Component (Spring Stereotype Annotations) and @Bean.

Getting Started with the Spring Boot Actuator

What is the Spring Boot Actuator and how can we use it in our applications?

Spring Boot includes a number of additional features to help you monitor and manage your application when it’s pushed to production. You can choose to manage and monitor your application using HTTP endpoints, with JMX or even by a remote shell (SSH or Telnet). Auditing, health and metrics gathering can be automatically applied to your application.

Spring Boot Actuator

In this article, we will take a look at how to include the actuator in your next project and what endpoints are available.