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:
“Stream has already been operated upon or closed” Exception in Java
Java Program to Implement WeakHashMap API
How to Get a Name of a Method Being Executed?
Java InputStream to String
Lớp Properties trong java
How to Replace Many if Statements in Java
Spring Boot - Enabling HTTPS
Java 14 Record Keyword
JPA/Hibernate Persistence Context
Java Program to Solve any Linear Equations
How to Break from Java Stream forEach
A Guide to JPA with Spring
Java – Try with Resources
A Guide to Java 9 Modularity
Spring Cloud AWS – S3
Java Program to Use rand and srand Functions
Java Program to Find Transitive Closure of a Graph
Java Program to Implement Nth Root Algorithm
Java 8 Stream findFirst() vs. findAny()
Java Program to Implement Jarvis Algorithm
Giới thiệu Google Guice – Binding
Apache Commons Collections OrderedMap
Retrieve User Information in Spring Security
Getting Started with Forms in Spring MVC
Basic Authentication with the RestTemplate
String Joiner trong Java 8
Working With Maps Using Streams
Java Program to Find the Longest Subsequence Common to All Sequences in a Set of Sequences
Java Program to Implement Traveling Salesman Problem using Nearest neighbour Algorithm
Java Program to Implement a Binary Search Tree using Linked Lists
Guava Collections Cookbook
Spring Security Custom AuthenticationFailureHandler