diff --git a/taglibs/src/main/java/org/springframework/security/taglibs/authz/AuthenticationTag.java b/taglibs/src/main/java/org/springframework/security/taglibs/authz/AuthenticationTag.java index 161b68cda8..613f3adced 100644 --- a/taglibs/src/main/java/org/springframework/security/taglibs/authz/AuthenticationTag.java +++ b/taglibs/src/main/java/org/springframework/security/taglibs/authz/AuthenticationTag.java @@ -33,7 +33,7 @@ import javax.servlet.jsp.tagext.TagSupport; /** * An {@link javax.servlet.jsp.tagext.Tag} implementation that allows convenient access to the current - * Authentication object. The operation attribute + * Authentication object. *

* Whilst JSPs can access the SecurityContext directly, this tag avoids handling null conditions. * @@ -93,13 +93,13 @@ public class AuthenticationTag extends TagSupport { if (auth.getPrincipal() == null) { return Tag.EVAL_PAGE; - } else { - try { - BeanWrapperImpl wrapper = new BeanWrapperImpl(auth); - result = wrapper.getPropertyValue(property); - } catch (BeansException e) { - throw new JspException(e); - } + } + + try { + BeanWrapperImpl wrapper = new BeanWrapperImpl(auth); + result = wrapper.getPropertyValue(property); + } catch (BeansException e) { + throw new JspException(e); } } @@ -120,7 +120,7 @@ public class AuthenticationTag extends TagSupport { } } } else { - writeMessage(result.toString()); + writeMessage(String.valueOf(result)); } return EVAL_PAGE; }