Skip to content

Tag: spring

How to apply the PathPatternParser introduced in Spring 5?

I want to create a GET request that takes a filepath as a path variable. As described in the Spring documentation found here, this should be possible by using the following: /resources/{*path}. I am using Spring Boot 2.1.2 which uses Spring 5. However when I set up my controller method like this, the request …

@PostConstruct and @PreDestroy annotations do not work

I have TennisCoach class: And such main class: Expected output is: Inside default constructor Inside postconstructor DailyFortune Practice your backhand volley Inside predestroyer But I get this: Inside default constructor DailyFortune Practice your backhand volley It seems like @PostContruct and @PreDestroy …

Accessing spring bean proxy reference itself

I have an issue with @Cacheable and @CacheEviction annotations. When I call these methods in the bean where they are declared, the aop part is not getting executed. The underlying reason for this is that the bean access to its own instance itself, instead of accessing the spring proxy. I have read this questi…