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 Find Hamiltonian Cycle in an UnWeighted Graph
Java Program to Use the Bellman-Ford Algorithm to Find the Shortest Path
Java – String to Reader
Java Program to Solve Travelling Salesman Problem for Unweighted Graph
Lớp Collections trong Java (Collections Utility Class)
Send an email using the SMTP protocol
Cơ chế Upcasting và Downcasting trong java
Java Program to Search for an Element in a Binary Search Tree
Introduction to the Java ArrayDeque
Rest Web service: Filter và Interceptor với Jersey 2.x (P1)
Introduction to Spring Cloud Netflix – Eureka
Chương trình Java đầu tiên
Java Program to Perform Stooge Sort
Mệnh đề if-else trong java
Stack Memory and Heap Space in Java
Java Program to Implement Skip List
Java Program to Find Transpose of a Graph Matrix
Spring Security Form Login
HttpClient with SSL
Implementing a Runnable vs Extending a Thread
Java Program to Find Inverse of a Matrix
Java Program to Implement Leftist Heap
HashSet trong Java hoạt động như thế nào?
Immutable ArrayList in Java
A Guide to Queries in Spring Data MongoDB
Introduction to Spring Data REST
Quick Intro to Spring Cloud Configuration
Java Program to Generate All Possible Subsets with Exactly k Elements in Each Subset
HttpClient Timeout
Java Program to Implement Hash Tables Chaining with Binary Trees
Filtering and Transforming Collections in Guava
Spring Boot - Servlet Filter