diff --git a/sandbox/heavyduty/pom.xml b/sandbox/heavyduty/pom.xml index 48cc0f82cb..d83036c881 100755 --- a/sandbox/heavyduty/pom.xml +++ b/sandbox/heavyduty/pom.xml @@ -4,7 +4,7 @@ spring-security-heavyduty Spring Security - Heavy Duty Sample war - 2.0.0 + 2.0.2-SNAPSHOT org.springframework.security @@ -58,6 +58,12 @@ runtime ${spring.version} + + org.freemarker + freemarker + runtime + 2.3.12 + hsqldb hsqldb @@ -160,7 +166,7 @@ 2.5.4 - 2.0.1-SNAPSHOT + 2.0.2-SNAPSHOT - \ No newline at end of file + diff --git a/sandbox/heavyduty/src/main/java/bigbank/web/ListAccounts.java b/sandbox/heavyduty/src/main/java/bigbank/web/ListAccounts.java index d0ea3ed67b..c33225ef37 100755 --- a/sandbox/heavyduty/src/main/java/bigbank/web/ListAccounts.java +++ b/sandbox/heavyduty/src/main/java/bigbank/web/ListAccounts.java @@ -3,7 +3,6 @@ package bigbank.web; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.springframework.security.AuthenticationCredentialsNotFoundException; import org.springframework.util.Assert; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.Controller; @@ -19,12 +18,7 @@ public class ListAccounts implements Controller { this.bankService = bankService; } - public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { - // Security check (this is unnecessary if Spring Security is performing the authorization) -// if (request.getUserPrincipal() == null) { -// throw new AuthenticationCredentialsNotFoundException("You must login to view the account list (Spring Security message)"); // only for Spring Security managed authentication -// } - + public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception { // Actual business logic ModelAndView mav = new ModelAndView("listAccounts"); mav.addObject("accounts", bankService.findAccounts()); diff --git a/sandbox/heavyduty/src/main/java/bigbank/web/PostAccounts.java b/sandbox/heavyduty/src/main/java/bigbank/web/PostAccounts.java index e5967b52e3..63c6bdf94f 100755 --- a/sandbox/heavyduty/src/main/java/bigbank/web/PostAccounts.java +++ b/sandbox/heavyduty/src/main/java/bigbank/web/PostAccounts.java @@ -3,7 +3,6 @@ package bigbank.web; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.springframework.security.AccessDeniedException; import org.springframework.util.Assert; import org.springframework.web.bind.ServletRequestUtils; import org.springframework.web.servlet.ModelAndView; diff --git a/sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-misc.xml b/sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-misc.xml index 67da7b4a52..9a98c4e4cf 100755 --- a/sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-misc.xml +++ b/sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-misc.xml @@ -10,8 +10,10 @@ + http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd"> @@ -45,6 +47,19 @@ My Realm + + + + + + + + bigbank.BankService.post*=ROLE_SUPERVISOR + bigbank.BankService.find*=ROLE_SUPERVISOR + + + diff --git a/sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-persistence.xml b/sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-persistence.xml index b1dd610e78..f72dbb83a4 100755 --- a/sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-persistence.xml +++ b/sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-persistence.xml @@ -15,9 +15,7 @@ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> - - classpath:jdbc.properties - + diff --git a/sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-security.xml b/sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-security.xml index c11ce17185..f0e83554a0 100755 --- a/sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-security.xml +++ b/sandbox/heavyduty/src/main/webapp/WEB-INF/appContext-security.xml @@ -10,45 +10,70 @@ xmlns:b="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd - http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.1.xsd"> + http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.2.xsd"> - - - + + + + + + + + + + + + - + + - - - - - + Uncomment to enable X509 client authentication support + +--> + - - + + + - + + + + - + + + + + + + + + + + + + + + + + + + **/testMulti.htm=testMultiController + + + + + \ No newline at end of file diff --git a/sandbox/heavyduty/src/main/webapp/WEB-INF/web.xml b/sandbox/heavyduty/src/main/webapp/WEB-INF/web.xml index e745ff4d3c..f43928bc2d 100755 --- a/sandbox/heavyduty/src/main/webapp/WEB-INF/web.xml +++ b/sandbox/heavyduty/src/main/webapp/WEB-INF/web.xml @@ -64,14 +64,14 @@ - Provides core MVC application controller. --> - bank + heavyduty org.springframework.web.servlet.DispatcherServlet 1 - bank - *.html + heavyduty + *.htm diff --git a/sandbox/heavyduty/src/main/webapp/index.jsp b/sandbox/heavyduty/src/main/webapp/index.jsp index edf1d00d0b..94a364172b 100755 --- a/sandbox/heavyduty/src/main/webapp/index.jsp +++ b/sandbox/heavyduty/src/main/webapp/index.jsp @@ -1,17 +1,17 @@ <%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> -

Home Page

+

HeavyDuty App Home Page

Anyone can view this page.

-

-If you're logged in, you can list accounts. +

+Test multi-action controller SEC-830.

Your principal object is....: <%= request.getUserPrincipal() %>

- +

Restricted Pages ...

Secure page

Extremely secure page