我正在使用spring-security-javaconfig库来实现Spring安全性.如果我使用xml配置文件,我会使用类似这样的内容来定义自定义访问被拒绝页面:
<http auto-config="true">
<intercept-url pattern="/admin*" access="ROLE_ADMIN" />
<access-denied-handler ref="accessDeniedHandler"/>
</http>
Run Code Online (Sandbox Code Playgroud)
到目前为止,这是我的安全配置类:
@Configuration
@EnableWebSecurity
public class SecurityConfigurator extends WebSecurityConfigurerAdapter {
@Override
protected void registerAuthentication(AuthenticationManagerBuilder auth)
throws Exception {
auth.inMemoryAuthentication().withUser("user").password("password").roles("USER");
auth.inMemoryAuthentication().withUser("admin").password("password").roles("ADMIN");
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeUrls().antMatchers( "/admin").hasRole("ADMIN");
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试更改 VSCode 设置,这将允许我使用方法链接执行类似操作:
Flux
.just("test", "string", "flux")
.log()
.map(String::toUpperCase);
Run Code Online (Sandbox Code Playgroud)
问题是每当应用格式化程序时,它都会将其更改回一行:
Flux.just("test", "string", "flux").log().map(String::toUpperCase);
Run Code Online (Sandbox Code Playgroud)
我安装了 Java 扩展包,其中包括“Red Hat 对 Java 的语言支持”。该扩展程序添加了一些格式选项,我一直在尝试使用它们,但没有这样的运气。
以下是我更改的格式选项:
"editor.formatOnSave": true,
"java.format.settings.url": "https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml",
"java.format.enabled": true,
"java.format.settings.profile": "GoogleStyle"
Run Code Online (Sandbox Code Playgroud)
任何人都知道如何让格式化程序单独保留多行方法链接?