Posts

Showing posts with the label spring-boot-maven-plugin

How to render jsp page from controller in spring boot?

How to render jsp page from controller in spring boot? I am new in spring boot.I want to render a jsp page from my spring boot controller.Anybody please help me to do the work.Thanks in advance. By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Getting NullPointerException when tried to read @Autowired configuration object [duplicate]

Image
Getting NullPointerException when tried to read @Autowired configuration object [duplicate] This question already has an answer here: I am trying to read some properties from application.properties . I have created a configuration class with @Component and @ConfigurationProperties annotations. application.properties @Component @ConfigurationProperties When I am trying to access the configuration from a controller class, its working fine. But when I am trying to access the configuration from one component class, its throwing a null pointer exception. Following are the application.properties and classes. application.properties application.properties elasticsearch.ip=localhost InputManagementController.java @RestController public class InputManagementController { @Autowired private Configuration configuration; @GetMapping("/crawler/start") public String start(){ try{ System.out.println(configuration.getIp()); ----> getting value localhos...