Method : 1
Go to: Run => Run Configurations :Click on the Arguments tap: Fill out this in the Program arguments:
--server.port=9000 --server.context-path=/test
I'm going to set port = 9000 and path url = /test
Method: 2
- In:src/main/resources
Create File name it as:
application.properties
Then set this configuration :
server.port=9000 server.context-path=/test
In Console you will see this:
Tomcat started on port(s): 9000 (http)
In your browser put the url like this: