Flo
Flo

Reputation: 27455

Equivalent of use-expressions attribute in XML based Spring Security configuration to code based configuration

How to enable the use-expressions option of the Spring Security configuration in a code based configuration? This option is needed to enable Expression-Based Access Control usage for Thymeleaf.

In the XML configuration it looks like this:

...
<http auto-config="true" use-expressions="true" >
   ...   
</http>
...

Upvotes: 6

Views: 2668

Answers (1)

Shinichi Kai
Shinichi Kai

Reputation: 4523

According to this blog post, use-expressions is set to true when using the Java Configuration.

Comparison to XML Namespace
...
One difference is that Java Configuration uses authorizeUrls 
to specify use-expressions="true"

Hope this helps.

Upvotes: 7

Related Questions