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:
Serialization và Deserialization trong java
Java Perform to a 2D FFT Inplace Given a Complex 2D Array
Java Program to Implement PriorityQueue API
Java Program to Implement Interval Tree
Spring MVC and the @ModelAttribute Annotation
Introduction to Using Thymeleaf in Spring
Bootstrapping Hibernate 5 with Spring
Java Program to Implement Ternary Tree
Java Program to Implement AttributeList API
Debug a HttpURLConnection problem
Thao tác với tập tin và thư mục trong Java
Java Program to Represent Graph Using Incidence List
Generic Constructors in Java
The Modulo Operator in Java
Class Loaders in Java
Collect a Java Stream to an Immutable Collection
Tìm hiểu về xác thực và phân quyền trong ứng dụng
Java Program to Represent Linear Equations in Matrix Form
Introduction to Java 8 Streams
Java – Reader to String
Hướng dẫn Java Design Pattern – Intercepting Filter
A Guide to Java HashMap
Loại bỏ các phần tử trùng trong một ArrayList như thế nào?
Lập trình đa luồng với CompletableFuture trong Java 8
Spring Boot - Batch Service
How to Find an Element in a List with Java
Sắp xếp trong Java 8
Java Program to Implement Regular Falsi Algorithm
Java Program to Implement Suffix Tree
Tính đa hình (Polymorphism) trong Java
How to Iterate Over a Stream With Indices
Java Program to Solve Travelling Salesman Problem for Unweighted Graph