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:
Spring @RequestParam Annotation
Java Program to Implement LinkedHashMap API
Guide to PriorityBlockingQueue in Java
Guide to Guava Multimap
Spring Boot - Tomcat Deployment
Java Program to Find All Pairs Shortest Path
Spring Data Java 8 Support
Java Program to Solve Knapsack Problem Using Dynamic Programming
Java Program to Implement LinkedBlockingQueue API
Java Program to Solve any Linear Equation in One Variable
Comparing Objects in Java
Java Program to Implement Bucket Sort
Java Program to Implement Hash Tables chaining with Singly Linked Lists
Java Program to Implement the Vigenere Cypher
Guide to BufferedReader
Java Program to Generate Random Hexadecimal Byte
Daemon Threads in Java
Java – Convert File to InputStream
Build a REST API with Spring and Java Config
Sử dụng CountDownLatch trong Java
Java Program to Create a Random Linear Extension for a DAG
Java Program to Perform Finite State Automaton based Search
Java Program to Implement HashTable API
Java – Get Random Item/Element From a List
Java Program to Perform String Matching Using String Library
Simple Single Sign-On with Spring Security OAuth2
Concrete Class in Java
Using a Custom Spring MVC’s Handler Interceptor to Manage Sessions
An Intro to Spring Cloud Vault
Java Program to Encode a Message Using Playfair Cipher
Tính đa hình (Polymorphism) trong Java
Java Program to Implement Bellman-Ford Algorithm