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. 

Migrating Grails 2.x Applications to Grails 3.x

What does it take to migrate a Grails 2.x project to Grails 3.x

At we work we have a number of huge applications running on Grails 2. When we first heard about the Grails 3 release we couldn’t wait to upgrade our applications and then we realized we couldn’t. About a year ago our team started to do some investigation into what it would take to upgrade all of our applications. What we quickly found out is that our applications weren’t the problem, it was all of the plugins.

Grails 3

In this article, we are going to walk through the problems that faced us and I am proud to say that those problems no longer exist today. We are in the middle of upgrading all of our applications at work and I will let you know how we are doing it. 

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

Bootstrapping your Angular Application

It is helpful to understand how your Angular application boots.

I recently wrote an article about how to get started with the Angular CLI. This is an awesome productivity tool when it comes to getting started with Angular. With it we can quickly create, build and run our applications. 

Bootstrapping Angular

This is really helpful but it also adds a little layer of magic to your application. If you always use the CLI but don’t take the time to appreciate what is happening behind the scenes you won’t understand how to fix problems when they come up. In this article, we are going to look at how Angular boots up your application. 

Angular Forms: How to clear an input field

A quick tutorial on how to clear an input field when you're done with it

I have been working on a few different Angular applications lately. It has been a ton of fun because I have learned so much and I have come across some real world problems that I can’t wait to share with you. 

Angular Forms

In today’s post, we are talking all about Angular Forms. I was working on a tasks applications that allowed you to add new tasks. When a new task was added I wanted to clear the form out so you could quickly add another one. I ran into a problem doing so and I wanted to share that problem and my solution with you today.

Getting Started with the Angular CLI

The best way to start creating Angular applications is to use the Angular CLI

I have worked on a variety of Angular applications over the last few months and it truly has been a blast. I know a lot of my readers out there are Java + Spring developers and I want to make sure that I make this very clear in this post and the ones that follow. If you played around with Angular 1.xx and didn’t really enjoy writing those applications you need to come back for another look.

Angular CLI

Writing angular 2/4 applications with Typescript is a familiar setting for Java Developers. I really do love working with the Angular framework and in today’s article, I am going to help you get started quickly by using the Angular CLI.