Table of Contents
Spring Boot lets you to run the same application more than once on a different port number. In this chapter, you will learn about this in detail. Note that the default port number 8080.
1. Custom Port
In the application.properties file, we can set custom port number for the property server.port
server.port = 9090
In the application.yml file, you can find as follows −
server: port: 9090
Random Port
In the application.properties file, we can set random port number for the property server.port
server.port = 0
In the application.yml file, you can find as follows −
server: port: 0
Note − If the server.port number is 0 while starting the Spring Boot application, Tomcat uses the random port number.
Related posts:
Tính đóng gói (Encapsulation) trong java
Java Program to Implement Binomial Tree
ETags for REST with Spring
Converting Iterator to List
Tránh lỗi ConcurrentModificationException trong Java như thế nào?
Java Stream Filter with Lambda Expression
Java Program to Implement ScapeGoat Tree
Spring Boot - Interceptor
Java Program to Find the Longest Path in a DAG
A Guide to ConcurrentMap
What is Thread-Safety and How to Achieve it?
Tính kế thừa (Inheritance) trong java
Java Program to Find the Minimum value of Binary Search Tree
Object cloning trong java
New Features in Java 14
Java Program to Implement Quick Sort Using Randomization
JPA/Hibernate Persistence Context
Java Program to Implement Levenshtein Distance Computing Algorithm
Java Program to Emulate N Dice Roller
Java Program to Permute All Letters of an Input String
Spring Data MongoDB – Indexes, Annotations and Converters
Java Program to Implement the Schonhage-Strassen Algorithm for Multiplication of Two Numbers
Java Program to Implement the Binary Counting Method to Generate Subsets of a Set
Java Program to Implement Min Hash
So sánh ArrayList và LinkedList trong Java
Tránh lỗi NullPointerException trong Java như thế nào?
Java Web Services – Jersey JAX-RS – REST và sử dụng REST API testing tools với Postman
Write/Read cookies using HTTP and Read a file from the internet
Guide To CompletableFuture
Java Program to Implement Kosaraju Algorithm
Spring Boot - Introduction
Java Program to Implement Ternary Search Tree