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:
Java Program to Implement vector
Exploring the Spring 5 WebFlux URL Matching
Spring Boot - Sending Email
Java Program to Perform the Shaker Sort
Java Program to Implement String Matching Using Vectors
Java Program to Implement Max Heap
Lớp Arrarys trong Java (Arrays Utility Class)
HttpClient Timeout
A Guide to Iterator in Java
Supplier trong Java 8
Reading an HTTP Response Body as a String in Java
Java Program to Perform Sorting Using B-Tree
A Guide to WatchService in Java NIO2
Java Program to Find Minimum Element in an Array using Linear Search
New Features in Java 10
Java Program to Sort an Array of 10 Elements Using Heap Sort Algorithm
Spring Boot - Code Structure
Default Password Encoder in Spring Security 5
Java Program to Find the Nearest Neighbor Using K-D Tree Search
Jackson – Decide What Fields Get Serialized/Deserialized
Java Program to Perform Left Rotation on a Binary Search Tree
DynamoDB in a Spring Boot Application Using Spring Data
Spring REST API + OAuth2 + Angular (using the Spring Security OAuth legacy stack)
Updating your Password
Phương thức tham chiếu trong Java 8 – Method References
Java Program to Implement RenderingHints API
Giới thiệu Aspect Oriented Programming (AOP)
Quick Guide to Spring Controllers
Converting Between a List and a Set in Java
Validate email address exists or not by Java Code
Java Program to Implement Caesar Cypher
Java Program to Generate All Possible Subsets with Exactly k Elements in Each Subset