Notice

╠ This is my personal blog and my posts here have nothing to do with my employers or any other association I may have. It is my personal blog for my personal experience, ideas and notes. ╣
Showing posts with label headless springboot springbootheadless. Show all posts
Showing posts with label headless springboot springbootheadless. Show all posts

Wednesday, January 19, 2022

Using the headless mode in Spring Boot

What is headless mode in Java?  

When an application does not require display, keyboard or mouse then system could be set as headless mode for the application. It could be done by setting the property System.setProperty("java.awt.headless", "true")

So why anyone would require headless mode / configuration? 

Let's say you are creating an application which convert an image into ACSII characters. This work does not require a mouse, keyboard or monitor. As this application will pick-up image from a predefined location and convert that image into ACSII characters. 
This is done to use the most of the computing power of the system. As image is converted in headless mode system then pass on to the headful system for the rendering of ASCII characters in display. 

In case of Spring Boot image banner printing, it is done using "java.awt.headless" system properties as true to print the image banner. The property is reset once the image banner printing is done.