JAVA EXAMPLE PROGRAMS

JAVA EXAMPLE PROGRAMS

Publish Your Article Here

Spring boot web application configurations.


In this page we will show some of the most commonly used spring boot web application based configurations.

Spring Boot comes with build in intelligence which makes it easy to create the web or standalone application. Spring Boot can do a lot of things for us without even writing a single line of code for our web application and we will be covering few of those configurations.

By default, sprint boot provides tomcat as a container and it runs on the default port 8080. Incase we want to change the default port, then we need to override the defalt port in the application.properties file.

Add below line in "application.properties" file:

server.port=7001

Default context for a Spring Boot web application is "/". Spring Boot allows us to change the application context through configurations. You can change it in "application.properties" file as shown below:

server.contextPath=/java2novice

Spring Boot has no required dependencies for the logging (except common logging API). Spring Boot internally use LoggingSystem abstraction that attempts to configure logging based on the content of the classpath.

We can fine tune log out in Spring Boot application by setting log level in the application.properties file using logging.level as a predefined prefix

logging.level.org.springframework.web=DEBUG
logging.level.org.hibernate=ERROR
<< Previous Program | Next Program >>

Spring-Boot Examples

  1. Spring-Boot initial setup.
  2. Spring-Boot hello world example
  3. What is spring-boot-starter-parent in Spring-Boot pom.xml file?
  4. What is @SpringBootApplication annotation in spring boot?
  5. What is application.properties in spring boot?
  6. What is @ConfigurationProperties annotation in spring boot?
  7. Spring Boot @ConfigurationProperties example
  8. Spring Boot @ConfigurationProperties Property Validation
  9. Difference between @ConfigurationProperties and @Value
  10. Spring boot web application configurations.
  11. How to run spring boot application through command line?
  12. How to run spring boot as a standalone application (non-web)?
  13. Spring boot property resolution order.
  14. Spring Boot – Profile based properties example.
  15. How to configure logback (SLF4J) logging to spring boot applications?
  16. How to update application context path in spring boot?
  17. How to disable spring logo banner in spring boot?
  18. Spring Data JPA with Spring Boot Applications - Oracle - example
  19. Spring Data JPA with Spring Boot Applications - MySql example
  20. How to configure Spring Boot to show Hibernate SQL Query in logs?
  21. Spring Boot – List all Beans loaded in the ApplicationContext
Knowledge Centre
What is adapter class?
An adapter class provides the default implementation of all methods in an event listener interface. Adapter classes are very useful when you want to process only few of the events that are handled by a particular event listener interface. You can define a new class by extending one of the adapter classes and implement only those events relevant to you.
Famous Quotations
We know what we are, but know not what we may be.
-- William Shakespeare

About Author

I'm Nataraja Gootooru, programmer by profession and passionate about technologies. All examples given here are as simple as possible to help beginners. The source code is compiled and tested in my dev environment.

If you come across any mistakes or bugs, please email me to [email protected] or you can comment on the page.

Most Visited Pages

Other Interesting Sites

Reference: Java™ Platform Standard Ed. 7 - API Specification | Java is registered trademark of Oracle.
Privacy Policy | Copyright © 2017 by Nataraja Gootooru. All Rights Reserved.