From f7ae69880c8034b5e4908a27a78a70b9beb1fc22 Mon Sep 17 00:00:00 2001 From: Ben Alex Date: Tue, 1 Apr 2008 17:15:31 +0000 Subject: [PATCH] Minor tweaking so the tutorial is a little more illustrative of the present namespace capabilities. --- .../main/java/bigbank/BankServiceImpl.java | 7 ++- samples/tutorial/src/main/webapp/login.jsp | 47 +++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 samples/tutorial/src/main/webapp/login.jsp diff --git a/samples/tutorial/src/main/java/bigbank/BankServiceImpl.java b/samples/tutorial/src/main/java/bigbank/BankServiceImpl.java index f33f52e7ab..e461e132d0 100644 --- a/samples/tutorial/src/main/java/bigbank/BankServiceImpl.java +++ b/samples/tutorial/src/main/java/bigbank/BankServiceImpl.java @@ -1,10 +1,15 @@ package bigbank; +import org.aspectj.lang.annotation.Pointcut; import org.springframework.util.Assert; public class BankServiceImpl implements BankService { private BankDao bankDao; - + + // Not used unless you declare a + @Pointcut("execution(* bigbank.BankServiceImpl.*(..))") + public void myPointcut() {} + public BankServiceImpl(BankDao bankDao) { Assert.notNull(bankDao); this.bankDao = bankDao; diff --git a/samples/tutorial/src/main/webapp/login.jsp b/samples/tutorial/src/main/webapp/login.jsp new file mode 100644 index 0000000000..d752d3975e --- /dev/null +++ b/samples/tutorial/src/main/webapp/login.jsp @@ -0,0 +1,47 @@ +<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core_rt' %> +<%@ page import="org.springframework.security.ui.AbstractProcessingFilter" %> +<%@ page import="org.springframework.security.ui.webapp.AuthenticationProcessingFilter" %> +<%@ page import="org.springframework.security.AuthenticationException" %> + + + + + + CUSTOM SPRING SECURITY LOGIN + + + +

CUSTOM SPRING SECURITY LOGIN

+ +

Valid users: +

+

username rod, password koala +
username dianne, password emu +
username scott, password wombat +
username peter, password opal +

+ + <%-- this form-login-page form is also used as the + form-error-page to ask for a login again. + --%> + <% if (session.getAttribute(AbstractProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY) != null) { %> + + Your login attempt was not successful, try again.

+ Reason: <%= ((AuthenticationException) session.getAttribute(AbstractProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %> +
+ <% } %> + +

+ + + + + + + +
User:value='<%= session.getAttribute(AuthenticationProcessingFilter.SPRING_SECURITY_LAST_USERNAME_KEY) %>'<% } %>>
Password:
Don't ask for my password for two weeks
+ +
+ + +