From 1b72e9d4e0a295d8e771914faa05ba1e56c07db1 Mon Sep 17 00:00:00 2001 From: Eleftheria Stein Date: Tue, 15 Jun 2021 15:32:17 +0200 Subject: [PATCH] Fix typos in FAQ docs --- .../asciidoc/_includes/servlet/appendix/faq.adoc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/manual/src/docs/asciidoc/_includes/servlet/appendix/faq.adoc b/docs/manual/src/docs/asciidoc/_includes/servlet/appendix/faq.adoc index 196c3992fe..83364019df 100644 --- a/docs/manual/src/docs/asciidoc/_includes/servlet/appendix/faq.adoc +++ b/docs/manual/src/docs/asciidoc/_includes/servlet/appendix/faq.adoc @@ -545,17 +545,18 @@ To use JDBC instead, you can implement the interface yourself, using whatever SQ JdbcTemplate template; List getGrantedAuthorities(DirContextOperations userData, String username) { - List = template.query("select role from roles where username = ?", - new String[] {username}, - new RowMapper() { - /** + return template.query("select role from roles where username = ?", + new String[] {username}, + new RowMapper() { + /** * We're assuming here that you're using the standard convention of using the role * prefix "ROLE_" to mark attributes which are supported by Spring Security's RoleVoter. */ + @Override public GrantedAuthority mapRow(ResultSet rs, int rowNum) throws SQLException { - return new SimpleGrantedAuthority("ROLE_" + rs.getString(1); + return new SimpleGrantedAuthority("ROLE_" + rs.getString(1)); } - } + }); } } @@ -580,7 +581,7 @@ The processor class would look like this: [source,java] ---- -public class BeanPostProcessor implements BeanPostProcessor { +public class CustomBeanPostProcessor implements BeanPostProcessor { public Object postProcessAfterInitialization(Object bean, String name) { if (bean instanceof UsernamePasswordAuthenticationFilter) {