Sample app build adjustments to remove unwanted deps such as jsp-api, tidy up use of JSTL, make sure all are using servlet 2.5 etc.
This commit is contained in:
@@ -4,10 +4,9 @@
|
||||
-
|
||||
-->
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
|
||||
|
||||
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
|
||||
<display-name>Spring Security CAS Demo Application</display-name>
|
||||
|
||||
<!--
|
||||
|
||||
@@ -21,6 +21,7 @@ dependencies {
|
||||
project(':spring-security-config'),
|
||||
project(':spring-security-taglibs'),
|
||||
"org.springframework:spring-context-support:$springVersion",
|
||||
"javax.servlet:jstl:$jstlVersion",
|
||||
"net.sf.ehcache:ehcache:$ehcacheVersion",
|
||||
"hsqldb:hsqldb:$hsqlVersion",
|
||||
"org.slf4j:jcl-over-slf4j:$slf4jVersion",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
|
||||
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@ page pageEncoding="UTF-8" %>
|
||||
|
||||
@@ -5,10 +5,9 @@
|
||||
-
|
||||
-->
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
|
||||
|
||||
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
|
||||
<display-name>Contacts Sample Application</display-name>
|
||||
|
||||
<!--
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core' %>
|
||||
<%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %>
|
||||
|
||||
<%@ page import="org.springframework.security.core.Authentication" %>
|
||||
<%@ page import="org.springframework.security.core.context.SecurityContextHolder" %>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core_rt' %>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ page pageEncoding="UTF-8" %>
|
||||
|
||||
<html>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
xmlns:s="http://www.springframework.org/schema/security"
|
||||
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-3.0.xsd
|
||||
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd">
|
||||
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">
|
||||
|
||||
<s:http>
|
||||
<s:intercept-url pattern="/secure/extreme/**" access="ROLE_SUPERVISOR"/>
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
- Tutorial web application
|
||||
-
|
||||
-->
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
|
||||
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
|
||||
|
||||
<display-name>Spring Security LDAP Demo Application</display-name>
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ dependencies {
|
||||
runtime project(':spring-security-web'),
|
||||
project(':spring-security-config'),
|
||||
project(':spring-security-taglibs'),
|
||||
"javax.servlet:jstl:$jstlVersion",
|
||||
"org.slf4j:jcl-over-slf4j:$slf4jVersion",
|
||||
"ch.qos.logback:logback-classic:$logbackVersion"
|
||||
}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
- Tutorial web application
|
||||
-
|
||||
-->
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
|
||||
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
|
||||
|
||||
<display-name>Spring Security OpenID Demo Application</display-name>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
|
||||
|
||||
<html>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core_rt' %>
|
||||
<%@ taglib prefix='c' uri='http://java.sun.com/jsp/jstl/core' %>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
@@ -53,7 +53,7 @@
|
||||
<input id="openid_submit" type="submit" value="Sign-In"/>
|
||||
</div>
|
||||
<noscript>
|
||||
<p>OpenID is a service that allows you to log-on to many different websites using a single indentity.
|
||||
<p>OpenID is a service that allows you to log-on to many different websites using a single identity.
|
||||
Find out <a href="http://openid.net/what/">more about OpenID</a> and <a href="http://openid.net/get/">how to get an OpenID enabled account</a>.</p>
|
||||
</noscript>
|
||||
</fieldset>
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
- Tutorial web application
|
||||
-
|
||||
-->
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
|
||||
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
|
||||
|
||||
<display-name>Spring Security Preauthentication Demo Application</display-name>
|
||||
|
||||
|
||||
@@ -19,16 +19,18 @@
|
||||
-->
|
||||
</global-method-security>
|
||||
|
||||
<http pattern="/loggedout.jsp" security="none"/>
|
||||
|
||||
<http use-expressions="true">
|
||||
<intercept-url pattern="/secure/extreme/**" access="hasRole('ROLE_SUPERVISOR')"/>
|
||||
<intercept-url pattern="/secure/**" access="isAuthenticated()" />
|
||||
<!-- Disable web URI authorization, as we're using <global-method-security> and have @Secured the services layer instead
|
||||
<intercept-url pattern="/listAccounts.html" access="isRememberMe()" />
|
||||
<intercept-url pattern="/post.html" access="hasRole('ROLE_TELLER')" />
|
||||
-->
|
||||
<!--
|
||||
Allow all other requests. In a real application you should
|
||||
adopt a whitelisting approach where access is not allowed by default
|
||||
-->
|
||||
<intercept-url pattern="/**" access="permitAll" />
|
||||
<form-login />
|
||||
<logout />
|
||||
<logout logout-success-url="/loggedout.jsp"/>
|
||||
<remember-me />
|
||||
<!--
|
||||
Uncomment to enable X509 client authentication support
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
|
||||
<h1>Accounts</h1>
|
||||
|
||||
@@ -14,23 +14,15 @@
|
||||
</tr>
|
||||
<c:forEach var="account" items="${accounts}">
|
||||
<tr>
|
||||
<td>${account.id}</td>
|
||||
<td>${account.holder}</td>
|
||||
<td>${account.balance}</td>
|
||||
<td>${account.overdraft}</td>
|
||||
<td>
|
||||
<c:out value="${account.id}"/>
|
||||
</td>
|
||||
<td>
|
||||
<c:out value="${account.holder}"/>
|
||||
</td>
|
||||
<td>
|
||||
<c:out value="${account.balance}"/>
|
||||
</td>
|
||||
<td>
|
||||
<c:out value="${account.overdraft}"/>
|
||||
</td>
|
||||
<td>
|
||||
<a href="post.html?id=<c:out value="${account.id}"/>&amount=-20.00">-$20</a>
|
||||
<a href="post.html?id=<c:out value="${account.id}"/>&amount=-5.00">-$5</a>
|
||||
<a href="post.html?id=<c:out value="${account.id}"/>&amount=5.00">+$5</a>
|
||||
<a href="post.html?id=<c:out value="${account.id}"/>&amount=20.00">+$20</a>
|
||||
<a href="post.html?id=${account.id}&amount=-20.00">-$20</a>
|
||||
<a href="post.html?id=${account.id}&amount=-5.00">-$5</a>
|
||||
<a href="post.html?id=${account.id}&amount=5.00">+$5</a>
|
||||
<a href="post.html?id=${account.id}&amount=20.00">+$20</a>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
-
|
||||
-->
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
|
||||
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
|
||||
|
||||
<display-name>Spring Security Tutorial Application</display-name>
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<%@page session="false" %>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
|
||||
|
||||
<%
|
||||
Cookie cookie = new Cookie("JSESSIONID", null);
|
||||
cookie.setPath(request.getContextPath());
|
||||
cookie.setMaxAge(0);
|
||||
response.addCookie(cookie);
|
||||
%>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Logged Out</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Logged Out</h2>
|
||||
<p>
|
||||
You have been logged out. <a href="<c:url value='/'/>">Start again</a>.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,8 +1,10 @@
|
||||
<%@page session="false" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Session Timeout</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Invalid Session</h2>
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ dependencies {
|
||||
runtime project(':spring-security-web'),
|
||||
project(':spring-security-config'),
|
||||
project(':spring-security-taglibs'),
|
||||
"javax.servlet:jstl:$jstlVersion",
|
||||
"org.slf4j:jcl-over-slf4j:$slf4jVersion",
|
||||
"ch.qos.logback:logback-core:$logbackVersion",
|
||||
"ch.qos.logback:logback-classic:$logbackVersion"
|
||||
|
||||
Reference in New Issue
Block a user