Spring Boot – How to disable @Cacheable during development?

The type of cache is by default automatically detected and configured. However you can specify which cache type to use by adding spring.cache.type to your configuration. To disable it set the value to NONE. As you want to do it for a specific profile add it to that profiles application.properties in this case modify the … Read more

Calling static methods from Spring Security Expressions?

By using the T(fully.qualified.name).methodName() syntax: You can use the special T operator to specify an instance of java.lang.Class (the type). Static methods are invoked by using this operator as well. The StandardEvaluationContext uses a TypeLocator to find types, and the StandardTypeLocator (which can be replaced) is built with an understanding of the java.lang package. This … Read more

How does Spring 3 expression language interact with property placeholders?

To access property placeholder from SpEL expression, the following syntax can be used: #{‘${x.y.z}’}. Hovewer, it can’t solve your problem with elvis operator and default values, because it would throw an exception when ${x.y.z} cannot be resolved. But you don’t need SpEL to declare default values for properties: <context:property-placeholder location=”…” properties-ref=”defaultValues”/> <bean id = “defaultValues” … Read more

How to fill HashMap from java property file with Spring @Value

You can use the SPEL json-like syntax to write a simple map or a map of list in property file. simple.map={‘KEY1’: ‘value1’, ‘KEY2’: ‘value3’, ‘KEY3’: ‘value5’} map.of.list={\ ‘KEY1’: {‘value1′,’value2’}, \ ‘KEY2’: {‘value3′,’value4’}, \ ‘KEY3’: {‘value5’} \ } I used \ for multiline property to enhance readability Then, in Java, you can access and parse it … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)