Developing SpringBoot Applications With NetBeans Part 2
In the previous article, we saw how to create SpringBoot projects within NetBeans using the awesome NB SpringBoot plugin.
In this article, we’ll continue the tour of the NB SpringBoot plugin and see in what other ways it can help you to develop Spring Boot applications usng NetBeans.
In addition to creating Spring Boot projects, the NB SpringBoot plugin provides differrent templates when creating classes. On the
New Class wizard, NB SpringBoot provides the options:
- Configuration Properties Class - creates a class annotated with
- CommandLineRunner Class - creates a class that
- ApplicationRunner Class - creates a class that
- Application Properties - creates an
- Additional Properties Metadata - creates a
- Configuration Class - creates a class annotated with
- Component Class - creates a class annotated with
- Service Class - creates a class annotated with
- Controller Class - creates a class annotated with
- REST Controller Class - creates a class annotated with
The Controller and RestController options are only available if you have added the
spring-boot-starter-web artifact to a project.
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency>
One of my favourite features of the NB SpringBoot plugin is the
application.properties file editor and its syntax highlghting and name completion.
When editing an
application.properties file, the editor provides popup completion for attribute name and attribute values as can be seen in the screen shot above. This can provide a great productivity boost when you can’t remember the exact name of properties to set. All of the available properties are displayed along with their type and a short description of what they do.
Request Mappings Navigation
Navigator panel within NetBeans, a new
Request Mappings drop down is avaiable. Selecting this shows all of the
@RequestMapping method within the currently selected class. Double clicking on any of these opens the appropriate method within the code editor.
There are many more features available within the NB SpringBoot plugin such as forcing a restart of a SpringBoot application, or confiring the start-up options for the application, but in this and the previous article we’ve seen how Spring Boot support is enhanced within NetBeans by installing the NB SpringBoot plugin.
If you develop applications in Spring Boot, this is a must-have plugin for NetBeans users.
What’s your favourite feature of this plugin, or do you think anthing is missing? Leave your comments below.