39 changed files with 630 additions and 1260 deletions
@ -0,0 +1,83 @@
@@ -0,0 +1,83 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> |
||||
|
||||
<!-- |
||||
- Application context definition for "contacts" DispatcherServlet. |
||||
- |
||||
- $Id: contacts-servlet.xml 1754 2006-11-17 02:01:21Z benalex $ |
||||
--> |
||||
|
||||
<beans> |
||||
|
||||
<!-- ========================== WEB DEFINITIONS ======================= --> |
||||
|
||||
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> |
||||
<property name="basename" value="messages"/> |
||||
</bean> |
||||
|
||||
<bean id="publicIndexController" class="sample.contact.PublicIndexController"> |
||||
<property name="contactManager" ref="contactManager"/> |
||||
</bean> |
||||
|
||||
<bean id="secureIndexController" class="sample.contact.SecureIndexController"> |
||||
<property name="contactManager" ref="contactManager"/> |
||||
</bean> |
||||
|
||||
<bean id="secureDeleteController" class="sample.contact.DeleteController"> |
||||
<property name="contactManager" ref="contactManager"/> |
||||
</bean> |
||||
|
||||
<bean id="adminPermissionController" class="sample.contact.AdminPermissionController"> |
||||
<property name="contactManager" ref="contactManager"/> |
||||
<property name="aclService" ref="aclService"/> |
||||
</bean> |
||||
|
||||
<bean id="deletePermissionController" class="sample.contact.DeletePermissionController"> |
||||
<property name="contactManager" ref="contactManager"/> |
||||
<property name="aclService" ref="aclService"/> |
||||
</bean> |
||||
|
||||
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> |
||||
<property name="mappings"> |
||||
<props> |
||||
<prop key="/hello.htm">publicIndexController</prop> |
||||
<prop key="/secure/add.htm">secureAddForm</prop> |
||||
<prop key="/secure/index.htm">secureIndexController</prop> |
||||
<prop key="/secure/del.htm">secureDeleteController</prop> |
||||
<prop key="/secure/adminPermission.htm">adminPermissionController</prop> |
||||
<prop key="/secure/deletePermission.htm">deletePermissionController</prop> |
||||
<prop key="/secure/addPermission.htm">addPermissionForm</prop> |
||||
</props> |
||||
</property> |
||||
</bean> |
||||
|
||||
<bean id="secureAddForm" class="sample.contact.WebContactAddController"> |
||||
<property name="sessionForm" value="true"/> |
||||
<property name="commandName" value="webContact"/> |
||||
<property name="commandClass" value="sample.contact.WebContact"/> |
||||
<property name="validator"> |
||||
<bean id="addValidator" class="sample.contact.WebContactValidator"/> |
||||
</property> |
||||
<property name="formView" value="add"/> |
||||
<property name="successView" value="index.htm"/> |
||||
<property name="contactManager" ref="contactManager"/> |
||||
</bean> |
||||
|
||||
<bean id="addPermissionForm" class="sample.contact.AddPermissionController"> |
||||
<property name="sessionForm" value="true"/> |
||||
<property name="commandName" value="addPermission"/> |
||||
<property name="commandClass" value="sample.contact.AddPermission"/> |
||||
<property name="validator"> |
||||
<bean id="addPermissionValidator" class="sample.contact.AddPermissionValidator"/> |
||||
</property> |
||||
<property name="formView" value="addPermission"/> |
||||
<property name="successView" value="index.htm"/> |
||||
<property name="contactManager" ref="contactManager"/> |
||||
</bean> |
||||
|
||||
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> |
||||
<property name="prefix" value="/WEB-INF/jsp/"/> |
||||
<property name="suffix" value=".jsp"/> |
||||
</bean> |
||||
|
||||
</beans> |
||||
@ -1,55 +1,55 @@
@@ -1,55 +1,55 @@
|
||||
<%@ include file="/WEB-INF/jsp/include.jsp" %> |
||||
<html> |
||||
<head><title>Add Permission</title></head> |
||||
<body> |
||||
<h1>Add Permission</h1> |
||||
<form method="post"> |
||||
<table width="95%" bgcolor="f8f8ff" border="0" cellspacing="0" cellpadding="5"> |
||||
<tr> |
||||
<td alignment="right" width="20%">Contact:</td> |
||||
<td width="60%"><c:out value="${addPermission.contact}"/></td> |
||||
</tr> |
||||
<tr> |
||||
<td alignment="right" width="20%">Recipient:</td> |
||||
<spring:bind path="addPermission.recipient"> |
||||
<td width="20%"> |
||||
<select name="<c:out value="${status.expression}"/>"> |
||||
<c:forEach var="thisRecipient" items="${recipients}"> |
||||
<option <c:if test="${thisRecipient.key == status.value}">selected</c:if> value="<c:out value="${thisRecipient.key}"/>"> |
||||
<c:out value="${thisRecipient.value}"/></option> |
||||
</c:forEach> |
||||
</select> |
||||
</td> |
||||
<td width="60%"> |
||||
<font color="red"><c:out value="${status.errorMessage}"/></font> |
||||
</td> |
||||
</spring:bind> |
||||
</tr> |
||||
<tr> |
||||
<td alignment="right" width="20%">Permission:</td> |
||||
<spring:bind path="addPermission.permission"> |
||||
<td width="20%"> |
||||
<select name="<c:out value="${status.expression}"/>"> |
||||
<c:forEach var="thisPermission" items="${permissions}"> |
||||
<option <c:if test="${thisPermission.key == status.value}">selected</c:if> value="<c:out value="${thisPermission.key}"/>"> |
||||
<c:out value="${thisPermission.value}"/></option> |
||||
</c:forEach> |
||||
</select> |
||||
</td> |
||||
<td width="60%"> |
||||
<font color="red"><c:out value="${status.errorMessage}"/></font> |
||||
</td> |
||||
</spring:bind> |
||||
</tr> |
||||
</table> |
||||
<br> |
||||
<spring:hasBindErrors name="webContact"> |
||||
<b>Please fix all errors!</b> |
||||
</spring:hasBindErrors> |
||||
<br><br> |
||||
<input name="execute" type="submit" alignment="center" value="Execute"> |
||||
</form> |
||||
<p> |
||||
<A HREF="<c:url value="adminPermission.htm"><c:param name="contactId" value="${addPermission.contact.id}"/></c:url>">Admin Permission</A> <a href="<c:url value="index.htm"/>">Manage</a> |
||||
</body> |
||||
</html> |
||||
<%@ include file="/WEB-INF/jsp/include.jsp" %> |
||||
<html> |
||||
<head><title>Add Permission</title></head> |
||||
<body> |
||||
<h1>Add Permission</h1> |
||||
<form method="post"> |
||||
<table width="95%" bgcolor="f8f8ff" border="0" cellspacing="0" cellpadding="5"> |
||||
<tr> |
||||
<td alignment="right" width="20%">Contact:</td> |
||||
<td width="60%"><c:out value="${addPermission.contact}"/></td> |
||||
</tr> |
||||
<tr> |
||||
<td alignment="right" width="20%">Recipient:</td> |
||||
<spring:bind path="addPermission.recipient"> |
||||
<td width="20%"> |
||||
<select name="<c:out value="${status.expression}"/>"> |
||||
<c:forEach var="thisRecipient" items="${recipients}"> |
||||
<option <c:if test="${thisRecipient.key == status.value}">selected</c:if> value="<c:out value="${thisRecipient.key}"/>"> |
||||
<c:out value="${thisRecipient.value}"/></option> |
||||
</c:forEach> |
||||
</select> |
||||
</td> |
||||
<td width="60%"> |
||||
<font color="red"><c:out value="${status.errorMessage}"/></font> |
||||
</td> |
||||
</spring:bind> |
||||
</tr> |
||||
<tr> |
||||
<td alignment="right" width="20%">Permission:</td> |
||||
<spring:bind path="addPermission.permission"> |
||||
<td width="20%"> |
||||
<select name="<c:out value="${status.expression}"/>"> |
||||
<c:forEach var="thisPermission" items="${permissions}"> |
||||
<option <c:if test="${thisPermission.key == status.value}">selected</c:if> value="<c:out value="${thisPermission.key}"/>"> |
||||
<c:out value="${thisPermission.value}"/></option> |
||||
</c:forEach> |
||||
</select> |
||||
</td> |
||||
<td width="60%"> |
||||
<font color="red"><c:out value="${status.errorMessage}"/></font> |
||||
</td> |
||||
</spring:bind> |
||||
</tr> |
||||
</table> |
||||
<br> |
||||
<spring:hasBindErrors name="webContact"> |
||||
<b>Please fix all errors!</b> |
||||
</spring:hasBindErrors> |
||||
<br><br> |
||||
<input name="execute" type="submit" alignment="center" value="Execute"> |
||||
</form> |
||||
<p> |
||||
<A HREF="<c:url value="adminPermission.htm"><c:param name="contactId" value="${addPermission.contact.id}"/></c:url>">Admin Permission</A> <a href="<c:url value="index.htm"/>">Manage</a> |
||||
</body> |
||||
</html> |
||||
@ -1,28 +1,28 @@
@@ -1,28 +1,28 @@
|
||||
<%@ include file="/WEB-INF/jsp/include.jsp" %> |
||||
|
||||
<html> |
||||
<head><title>Administer Permissions</title></head> |
||||
<body> |
||||
<h1>Administer Permissions</h1> |
||||
<P> |
||||
<code> |
||||
<c:out value="${model.contact}"/> |
||||
</code> |
||||
<P> |
||||
<table cellpadding=3 border=0> |
||||
<c:forEach var="acl" items="${model.acl.entries}"> |
||||
<tr> |
||||
<td> |
||||
<code> |
||||
<c:out value="${acl}"/> |
||||
</code> |
||||
</td> |
||||
<td> |
||||
<A HREF="<c:url value="deletePermission.htm"><c:param name="contactId" value="${model.contact.id}"/><c:param name="sid" value="${acl.sid.principal}"/><c:param name="permission" value="${acl.permission.mask}"/></c:url>">Del</A> |
||||
</td> |
||||
</tr> |
||||
</c:forEach> |
||||
</table> |
||||
<p><a href="<c:url value="addPermission.htm"><c:param name="contactId" value="${model.contact.id}"/></c:url>">Add Permission</a> <a href="<c:url value="index.htm"/>">Manage</a> |
||||
</body> |
||||
</html> |
||||
<%@ include file="/WEB-INF/jsp/include.jsp" %> |
||||
|
||||
<html> |
||||
<head><title>Administer Permissions</title></head> |
||||
<body> |
||||
<h1>Administer Permissions</h1> |
||||
<P> |
||||
<code> |
||||
<c:out value="${model.contact}"/> |
||||
</code> |
||||
<P> |
||||
<table cellpadding=3 border=0> |
||||
<c:forEach var="acl" items="${model.acl.entries}"> |
||||
<tr> |
||||
<td> |
||||
<code> |
||||
<c:out value="${acl}"/> |
||||
</code> |
||||
</td> |
||||
<td> |
||||
<A HREF="<c:url value="deletePermission.htm"><c:param name="contactId" value="${model.contact.id}"/><c:param name="sid" value="${acl.sid.principal}"/><c:param name="permission" value="${acl.permission.mask}"/></c:url>">Del</A> |
||||
</td> |
||||
</tr> |
||||
</c:forEach> |
||||
</table> |
||||
<p><a href="<c:url value="addPermission.htm"><c:param name="contactId" value="${model.contact.id}"/></c:url>">Add Permission</a> <a href="<c:url value="index.htm"/>">Manage</a> |
||||
</body> |
||||
</html> |
||||
@ -1,20 +1,20 @@
@@ -1,20 +1,20 @@
|
||||
<%@ include file="/WEB-INF/jsp/include.jsp" %> |
||||
|
||||
<html> |
||||
<head><title>Permission Deleted</title></head> |
||||
<body> |
||||
<h1>Permission Deleted</h1> |
||||
<P> |
||||
<code> |
||||
<c:out value="${model.contact}"/> |
||||
</code> |
||||
<P> |
||||
<code> |
||||
<c:out value="${model.sid}"/> |
||||
</code> |
||||
<%@ include file="/WEB-INF/jsp/include.jsp" %> |
||||
|
||||
<html> |
||||
<head><title>Permission Deleted</title></head> |
||||
<body> |
||||
<h1>Permission Deleted</h1> |
||||
<P> |
||||
<code> |
||||
<c:out value="${model.contact}"/> |
||||
</code> |
||||
<P> |
||||
<code> |
||||
<c:out value="${model.sid}"/> |
||||
</code> |
||||
<code> |
||||
<c:out value="${model.permission}"/> |
||||
</code> |
||||
<p><a href="<c:url value="index.htm"/>">Manage</a> |
||||
</body> |
||||
</html> |
||||
<p><a href="<c:url value="index.htm"/>">Manage</a> |
||||
</body> |
||||
</html> |
||||
@ -1,16 +1,16 @@
@@ -1,16 +1,16 @@
|
||||
<%@ page import="org.acegisecurity.context.SecurityContextHolder" %> |
||||
<%@ page import="org.acegisecurity.Authentication" %> |
||||
<%@ page import="org.acegisecurity.ui.AccessDeniedHandlerImpl" %> |
||||
|
||||
<h1>Sorry, access is denied</h1> |
||||
|
||||
|
||||
<p> |
||||
<%= request.getAttribute(AccessDeniedHandlerImpl.ACEGI_SECURITY_ACCESS_DENIED_EXCEPTION_KEY)%> |
||||
|
||||
<p> |
||||
|
||||
<% Authentication auth = SecurityContextHolder.getContext().getAuthentication(); |
||||
if (auth != null) { %> |
||||
Authentication object as a String: <%= auth.toString() %><BR><BR> |
||||
<% } %> |
||||
<%@ page import="org.acegisecurity.context.SecurityContextHolder" %> |
||||
<%@ page import="org.acegisecurity.Authentication" %> |
||||
<%@ page import="org.acegisecurity.ui.AccessDeniedHandlerImpl" %> |
||||
|
||||
<h1>Sorry, access is denied</h1> |
||||
|
||||
|
||||
<p> |
||||
<%= request.getAttribute(AccessDeniedHandlerImpl.ACEGI_SECURITY_ACCESS_DENIED_EXCEPTION_KEY)%> |
||||
|
||||
<p> |
||||
|
||||
<% Authentication auth = SecurityContextHolder.getContext().getAuthentication(); |
||||
if (auth != null) { %> |
||||
Authentication object as a String: <%= auth.toString() %><BR><BR> |
||||
<% } %> |
||||
@ -1,70 +0,0 @@
@@ -1,70 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> |
||||
|
||||
<!-- |
||||
- Application context containing authentication, channel |
||||
- security and web URI beans. |
||||
- |
||||
- Only used by "ca" artifact. |
||||
- |
||||
- $Id$ |
||||
--> |
||||
|
||||
<beans> |
||||
|
||||
<!-- ======================== FILTER CHAIN ======================= --> |
||||
|
||||
<!-- if you wish to use channel security, add "channelProcessingFilter," in front |
||||
of "authenticationProcessingFilter" in the list below --> |
||||
<bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy"> |
||||
<property name="filterInvocationDefinitionSource"> |
||||
<value> |
||||
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON |
||||
PATTERN_TYPE_APACHE_ANT |
||||
/**=httpSessionContextIntegrationFilter,httpRequestIntegrationFilter,logoutFilter |
||||
</value> |
||||
</property> |
||||
</bean> |
||||
|
||||
<!-- ======================== AUTHENTICATION ======================= --> |
||||
|
||||
<!-- We could also have a daoAuthenticationProvider in order to |
||||
process BASIC authentication requests, but this has been |
||||
left out given container adapters aren't recommended and |
||||
it would increase the number of bean declarations required --> |
||||
<bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager"> |
||||
<property name="providers"> |
||||
<list> |
||||
<ref local="authByAdapterProvider"/> |
||||
</list> |
||||
</property> |
||||
</bean> |
||||
|
||||
<bean id="authByAdapterProvider" class="org.acegisecurity.adapters.AuthByAdapterProvider"> |
||||
<property name="key"><value>my_password</value></property> |
||||
</bean> |
||||
|
||||
<bean id="httpRequestIntegrationFilter" class="org.acegisecurity.adapters.HttpRequestIntegrationFilter"/> |
||||
|
||||
<bean id="httpSessionContextIntegrationFilter" class="org.acegisecurity.context.HttpSessionContextIntegrationFilter"> |
||||
</bean> |
||||
|
||||
<!-- note logout has little impact, due to container authentication functionality (used only so /j_acegi_logout doesn't give URL error) --> |
||||
<bean id="logoutFilter" class="org.acegisecurity.ui.logout.LogoutFilter"> |
||||
<constructor-arg value="/index.jsp"/> <!-- URL redirected to after logout --> |
||||
<constructor-arg> |
||||
<list> |
||||
<bean class="org.acegisecurity.ui.logout.SecurityContextLogoutHandler"/> |
||||
</list> |
||||
</constructor-arg> |
||||
</bean> |
||||
|
||||
<!-- ===================== HTTP CHANNEL REQUIREMENTS ==================== --> |
||||
|
||||
<!-- Implement by servlet specification --> |
||||
|
||||
<!-- ===================== HTTP REQUEST SECURITY ==================== --> |
||||
|
||||
<!-- Implement by servlet specification --> |
||||
|
||||
</beans> |
||||
@ -1,48 +0,0 @@
@@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> |
||||
<!-- |
||||
* The Acegi Security System for Spring is published under the terms |
||||
* of the Apache Software License. |
||||
* |
||||
* This springsecurity.xml file will only be used by Resin. Normally the |
||||
* springsecurity.xml is container-wide, but in the case of Resin it is |
||||
* web application specific. |
||||
* |
||||
* $Id$ |
||||
* |
||||
* This file will be copied into WAR's classes directory if using container adapter |
||||
* |
||||
--> |
||||
|
||||
<beans> |
||||
|
||||
<!-- ================= CONTAINER ADAPTER CONFIGURATION ================ --> |
||||
|
||||
<!-- Data access object which stores authentication information --> |
||||
<bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl"> |
||||
<property name="userMap"> |
||||
<value> |
||||
marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR |
||||
dianne=emu,ROLE_TELLER |
||||
scott=wombat,ROLE_TELLER |
||||
peter=opal,disabled,ROLE_TELLER |
||||
</value> |
||||
</property> |
||||
</bean> |
||||
|
||||
<!-- Authentication provider that queries our data access object --> |
||||
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"> |
||||
<property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property> |
||||
<property name="forcePrincipalAsString"><value>true</value></property> |
||||
</bean> |
||||
|
||||
<!-- The authentication manager that iterates through our only authentication provider --> |
||||
<bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager"> |
||||
<property name="providers"> |
||||
<list> |
||||
<ref bean="daoAuthenticationProvider"/> |
||||
</list> |
||||
</property> |
||||
</bean> |
||||
|
||||
</beans> |
||||
@ -1,7 +0,0 @@
@@ -1,7 +0,0 @@
|
||||
<!-- |
||||
- $Id$ |
||||
- File will be copied into WAR's WEB-INF directory if using container adapter |
||||
--> |
||||
<jboss-web> |
||||
<security-domain>java:/jaas/SpringPoweredRealm</security-domain> |
||||
</jboss-web> |
||||
@ -1,13 +0,0 @@
@@ -1,13 +0,0 @@
|
||||
<!-- |
||||
- $Id$ |
||||
- File will be copied into WAR's WEB-INF directory if using container adapter |
||||
--> |
||||
<web-app> |
||||
<authenticator> |
||||
<type>org.acegisecurity.adapters.resin.ResinAcegiAuthenticator</type> |
||||
<init> |
||||
<app-context-location>resin-acegisecurity.xml</app-context-location> |
||||
<key>my_password</key> |
||||
</init> |
||||
</authenticator> |
||||
</web-app> |
||||
@ -1,137 +0,0 @@
@@ -1,137 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'> |
||||
|
||||
<!-- |
||||
- Contacts web application |
||||
- |
||||
- web.xml for "ca" artifact only. |
||||
- |
||||
- $Id$ |
||||
--> |
||||
|
||||
<web-app> |
||||
|
||||
<display-name>Contacts Sample Application</display-name> |
||||
|
||||
<!-- |
||||
- Location of the XML file that defines the root application context |
||||
- Applied by ContextLoaderListener. |
||||
--> |
||||
<context-param> |
||||
<param-name>contextConfigLocation</param-name> |
||||
<param-value> |
||||
/WEB-INF/applicationContext-acegi-security.xml |
||||
classpath:applicationContext-common-business.xml |
||||
classpath:applicationContext-common-authorization.xml |
||||
</param-value> |
||||
</context-param> |
||||
|
||||
<context-param> |
||||
<param-name>log4jConfigLocation</param-name> |
||||
<param-value>/WEB-INF/classes/log4j.properties</param-value> |
||||
</context-param> |
||||
|
||||
<filter> |
||||
<filter-name>Acegi Filter Chain Proxy</filter-name> |
||||
<filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class> |
||||
<init-param> |
||||
<param-name>targetClass</param-name> |
||||
<param-value>org.acegisecurity.util.FilterChainProxy</param-value> |
||||
</init-param> |
||||
</filter> |
||||
|
||||
<filter-mapping> |
||||
<filter-name>Acegi Filter Chain Proxy</filter-name> |
||||
<url-pattern>/*</url-pattern> |
||||
</filter-mapping> |
||||
|
||||
|
||||
<!-- |
||||
- Loads the root application context of this web app at startup. |
||||
- The application context is then available via |
||||
- WebApplicationContextUtils.getWebApplicationContext(servletContext). |
||||
--> |
||||
<listener> |
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> |
||||
</listener> |
||||
|
||||
<listener> |
||||
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> |
||||
</listener> |
||||
|
||||
<!-- |
||||
- Provides core MVC application controller. See contacts-servlet.xml. |
||||
--> |
||||
<servlet> |
||||
<servlet-name>contacts</servlet-name> |
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
||||
<load-on-startup>1</load-on-startup> |
||||
</servlet> |
||||
|
||||
<!-- |
||||
- Provides web services endpoint. See remoting-servlet.xml. |
||||
--> |
||||
<servlet> |
||||
<servlet-name>remoting</servlet-name> |
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
||||
<load-on-startup>2</load-on-startup> |
||||
</servlet> |
||||
|
||||
<servlet-mapping> |
||||
<servlet-name>contacts</servlet-name> |
||||
<url-pattern>*.htm</url-pattern> |
||||
</servlet-mapping> |
||||
|
||||
<servlet-mapping> |
||||
<servlet-name>remoting</servlet-name> |
||||
<url-pattern>/remoting/*</url-pattern> |
||||
</servlet-mapping> |
||||
|
||||
<welcome-file-list> |
||||
<welcome-file>index.jsp</welcome-file> |
||||
</welcome-file-list> |
||||
|
||||
<taglib> |
||||
<taglib-uri>/spring</taglib-uri> |
||||
<taglib-location>/WEB-INF/spring.tld</taglib-location> |
||||
</taglib> |
||||
|
||||
<security-constraint> |
||||
<display-name>Secured Area Security Constraint</display-name> |
||||
<web-resource-collection> |
||||
<web-resource-name>Secured Area</web-resource-name> |
||||
<url-pattern>/secure/*</url-pattern> |
||||
</web-resource-collection> |
||||
<auth-constraint> |
||||
<role-name>ROLE_USER</role-name> |
||||
<role-name>ROLE_SUPERVISOR</role-name> |
||||
</auth-constraint> |
||||
</security-constraint> |
||||
|
||||
<!-- Default login configuration using BASIC authentication --> |
||||
<!-- |
||||
<login-config> |
||||
<auth-method>BASIC</auth-method> |
||||
<realm-name>Spring Powered Realm</realm-name> |
||||
</login-config> |
||||
--> |
||||
|
||||
<!-- Default login configuration using form-based authentication --> |
||||
<login-config> |
||||
<auth-method>FORM</auth-method> |
||||
<realm-name>Spring Powered Realm</realm-name> |
||||
<form-login-config> |
||||
<form-login-page>/login.jsp</form-login-page> |
||||
<form-error-page>/login.jsp?login_error=1</form-error-page> |
||||
</form-login-config> |
||||
</login-config> |
||||
|
||||
<!-- Security roles referenced by this web application --> |
||||
<security-role> |
||||
<role-name>ROLE_SUPERVISOR</role-name> |
||||
</security-role> |
||||
<security-role> |
||||
<role-name>ROLE_USER</role-name> |
||||
</security-role> |
||||
|
||||
</web-app> |
||||
@ -1,46 +0,0 @@
@@ -1,46 +0,0 @@
|
||||
<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core' %> |
||||
<html> |
||||
<head> |
||||
<title>Login</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<h1>Login</h1> |
||||
|
||||
<P>Valid users: |
||||
<P> |
||||
<P>username <b>marissa</b>, password <b>koala</b> |
||||
<P>username <b>dianne</b>, password <b>emu</b> |
||||
<p>username <b>scott</b>, password <b>wombat</b> |
||||
<p>username <b>peter</b>, password <b>opal</b> (user disabled) |
||||
<p>username <b>bill</b>, password <b>wombat</b> |
||||
<p>username <b>bob</b>, password <b>wombat</b> |
||||
<p>username <b>jane</b>, password <b>wombat</b> |
||||
<p> |
||||
|
||||
<%-- this form-login-page form is also used as the |
||||
form-error-page to ask for a login again. |
||||
--%> |
||||
<c:if test="${not empty param.login_error}"> |
||||
<font color="red"> |
||||
Your login attempt was not successful, try again. |
||||
</font> |
||||
</c:if> |
||||
|
||||
<form action="<c:url value='j_security_check'/>" method="POST"> |
||||
<table> |
||||
<tr><td>User:</td><td><input type='text' name='j_username'></td></tr> |
||||
<tr><td>Password:</td><td><input type='password' name='j_password'></td></tr> |
||||
|
||||
<tr><td colspan='2'><input name="submit" type="submit"></td></tr> |
||||
<tr><td colspan='2'><input name="reset" type="reset"></td></tr> |
||||
</table> |
||||
|
||||
<!-- |
||||
- The j_uri is a Resin requirement (ignored by other containers) |
||||
--> |
||||
<input type='hidden' name='j_uri' value='/secure/index.htm'/> |
||||
</form> |
||||
|
||||
</body> |
||||
</html> |
||||
@ -1,107 +0,0 @@
@@ -1,107 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'> |
||||
|
||||
<!-- |
||||
- Contacts web application |
||||
- |
||||
- web.xml for "cas" artifact only. |
||||
- |
||||
- $Id$ |
||||
--> |
||||
|
||||
<web-app> |
||||
|
||||
<display-name>Contacts Sample Application</display-name> |
||||
|
||||
<!-- |
||||
- Location of the XML file that defines the root application context |
||||
- Applied by ContextLoaderListener. |
||||
--> |
||||
<context-param> |
||||
<param-name>contextConfigLocation</param-name> |
||||
<param-value> |
||||
/WEB-INF/applicationContext-acegi-security.xml |
||||
classpath:applicationContext-common-business.xml |
||||
classpath:applicationContext-common-authorization.xml |
||||
</param-value> |
||||
</context-param> |
||||
|
||||
<context-param> |
||||
<param-name>log4jConfigLocation</param-name> |
||||
<param-value>/WEB-INF/classes/log4j.properties</param-value> |
||||
</context-param> |
||||
|
||||
<!-- Required for CAS ProxyTicketReceptor servlet. This is the |
||||
URL to CAS' "proxy" actuator, where a PGT and TargetService can |
||||
be presented to obtain a new proxy ticket. THIS CAN BE |
||||
REMOVED IF THE APPLICATION DOESN'T NEED TO ACT AS A PROXY --> |
||||
<context-param> |
||||
<param-name>edu.yale.its.tp.cas.proxyUrl</param-name> |
||||
<param-value>http://localhost:8433/cas/proxy</param-value> |
||||
</context-param> |
||||
|
||||
<filter> |
||||
<filter-name>Acegi Filter Chain Proxy</filter-name> |
||||
<filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class> |
||||
<init-param> |
||||
<param-name>targetClass</param-name> |
||||
<param-value>org.acegisecurity.util.FilterChainProxy</param-value> |
||||
</init-param> |
||||
</filter> |
||||
|
||||
<filter-mapping> |
||||
<filter-name>Acegi Filter Chain Proxy</filter-name> |
||||
<url-pattern>/*</url-pattern> |
||||
</filter-mapping> |
||||
|
||||
<!-- |
||||
- Loads the root application context of this web app at startup. |
||||
- The application context is then available via |
||||
- WebApplicationContextUtils.getWebApplicationContext(servletContext). |
||||
--> |
||||
<listener> |
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> |
||||
</listener> |
||||
|
||||
<listener> |
||||
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> |
||||
</listener> |
||||
|
||||
<!-- |
||||
- Provides core MVC application controller. See contacts-servlet.xml. |
||||
--> |
||||
<servlet> |
||||
<servlet-name>contacts</servlet-name> |
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
||||
<load-on-startup>1</load-on-startup> |
||||
</servlet> |
||||
|
||||
<!-- |
||||
- Provides web services endpoint. See remoting-servlet.xml. |
||||
--> |
||||
<servlet> |
||||
<servlet-name>remoting</servlet-name> |
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
||||
<load-on-startup>2</load-on-startup> |
||||
</servlet> |
||||
|
||||
<servlet-mapping> |
||||
<servlet-name>contacts</servlet-name> |
||||
<url-pattern>*.htm</url-pattern> |
||||
</servlet-mapping> |
||||
|
||||
<servlet-mapping> |
||||
<servlet-name>remoting</servlet-name> |
||||
<url-pattern>/remoting/*</url-pattern> |
||||
</servlet-mapping> |
||||
|
||||
<welcome-file-list> |
||||
<welcome-file>index.jsp</welcome-file> |
||||
</welcome-file-list> |
||||
|
||||
<taglib> |
||||
<taglib-uri>/spring</taglib-uri> |
||||
<taglib-location>/WEB-INF/spring.tld</taglib-location> |
||||
</taglib> |
||||
|
||||
</web-app> |
||||
@ -1,87 +0,0 @@
@@ -1,87 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> |
||||
|
||||
<!-- |
||||
- Application context definition for "contacts" DispatcherServlet. |
||||
- |
||||
- $Id$ |
||||
--> |
||||
|
||||
<beans> |
||||
|
||||
<!-- ========================== WEB DEFINITIONS ======================= --> |
||||
|
||||
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> |
||||
<property name="basename"><value>messages</value></property> |
||||
</bean> |
||||
|
||||
<bean id="publicIndexController" class="sample.contact.PublicIndexController"> |
||||
<property name="contactManager"><ref bean="contactManager"/></property> |
||||
</bean> |
||||
|
||||
<bean id="secureIndexController" class="sample.contact.SecureIndexController"> |
||||
<property name="contactManager"><ref bean="contactManager"/></property> |
||||
</bean> |
||||
|
||||
<bean id="secureDeleteController" class="sample.contact.DeleteController"> |
||||
<property name="contactManager"><ref bean="contactManager"/></property> |
||||
</bean> |
||||
|
||||
<bean id="adminPermissionController" class="sample.contact.AdminPermissionController"> |
||||
<property name="contactManager"><ref bean="contactManager"/></property> |
||||
<property name="aclService"><ref bean="aclService"/></property> |
||||
</bean> |
||||
|
||||
<bean id="deletePermissionController" class="sample.contact.DeletePermissionController"> |
||||
<property name="contactManager"><ref bean="contactManager"/></property> |
||||
<property name="aclService"><ref bean="aclService"/></property> |
||||
</bean> |
||||
|
||||
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> |
||||
<property name="mappings"> |
||||
<props> |
||||
<prop key="/hello.htm">publicIndexController</prop> |
||||
<prop key="/secure/add.htm">secureAddForm</prop> |
||||
<prop key="/secure/index.htm">secureIndexController</prop> |
||||
<prop key="/secure/del.htm">secureDeleteController</prop> |
||||
<prop key="/secure/adminPermission.htm">adminPermissionController</prop> |
||||
<prop key="/secure/deletePermission.htm">deletePermissionController</prop> |
||||
<prop key="/secure/addPermission.htm">addPermissionForm</prop> |
||||
</props> |
||||
</property> |
||||
</bean> |
||||
|
||||
<bean id="addValidator" class="sample.contact.WebContactValidator"/> |
||||
|
||||
<bean id="addPermissionValidator" class="sample.contact.AddPermissionValidator"/> |
||||
|
||||
<bean id="secureAddForm" class="sample.contact.WebContactAddController"> |
||||
<property name="sessionForm"><value>true</value></property> |
||||
<property name="commandName"><value>webContact</value></property> |
||||
<property name="commandClass"><value>sample.contact.WebContact</value></property> |
||||
<property name="validator"><ref bean="addValidator"/></property> |
||||
<property name="formView"><value>add</value></property> |
||||
<property name="successView"><value>index.htm</value></property> |
||||
<property name="contactManager"> |
||||
<ref bean="contactManager"/> |
||||
</property> |
||||
</bean> |
||||
|
||||
<bean id="addPermissionForm" class="sample.contact.AddPermissionController"> |
||||
<property name="sessionForm"><value>true</value></property> |
||||
<property name="commandName"><value>addPermission</value></property> |
||||
<property name="commandClass"><value>sample.contact.AddPermission</value></property> |
||||
<property name="validator"><ref bean="addPermissionValidator"/></property> |
||||
<property name="formView"><value>addPermission</value></property> |
||||
<property name="successView"><value>index.htm</value></property> |
||||
<property name="contactManager"> |
||||
<ref bean="contactManager"/> |
||||
</property> |
||||
</bean> |
||||
|
||||
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> |
||||
<property name="prefix"><value>/WEB-INF/jsp/</value></property> |
||||
<property name="suffix"><value>.jsp</value></property> |
||||
</bean> |
||||
|
||||
</beans> |
||||
@ -1,107 +0,0 @@
@@ -1,107 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'> |
||||
|
||||
<!-- |
||||
- Contacts web application |
||||
- |
||||
- web.xml for "filter" artifact only. |
||||
- |
||||
- $Id$ |
||||
--> |
||||
|
||||
<web-app> |
||||
|
||||
<display-name>Contacts Sample Application</display-name> |
||||
|
||||
<!-- |
||||
- Location of the XML file that defines the root application context |
||||
- Applied by ContextLoaderListener. |
||||
--> |
||||
<context-param> |
||||
<param-name>contextConfigLocation</param-name> |
||||
<param-value> |
||||
/WEB-INF/applicationContext-acegi-security.xml |
||||
classpath:applicationContext-common-business.xml |
||||
classpath:applicationContext-common-authorization.xml |
||||
</param-value> |
||||
</context-param> |
||||
|
||||
<context-param> |
||||
<param-name>log4jConfigLocation</param-name> |
||||
<param-value>/WEB-INF/classes/log4j.properties</param-value> |
||||
</context-param> |
||||
|
||||
<filter> |
||||
<filter-name>Acegi Filter Chain Proxy</filter-name> |
||||
<filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class> |
||||
<init-param> |
||||
<param-name>targetClass</param-name> |
||||
<param-value>org.acegisecurity.util.FilterChainProxy</param-value> |
||||
</init-param> |
||||
</filter> |
||||
|
||||
<filter-mapping> |
||||
<filter-name>Acegi Filter Chain Proxy</filter-name> |
||||
<url-pattern>/*</url-pattern> |
||||
</filter-mapping> |
||||
|
||||
<!-- |
||||
- Loads the root application context of this web app at startup. |
||||
- The application context is then available via |
||||
- WebApplicationContextUtils.getWebApplicationContext(servletContext). |
||||
--> |
||||
<listener> |
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> |
||||
</listener> |
||||
|
||||
<listener> |
||||
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> |
||||
</listener> |
||||
|
||||
<!-- |
||||
The HttpSessionEventPublisher will publish |
||||
HttpSessionCreatedEvent and HttpSessionDestroyedEvent |
||||
to the WebApplicationContext |
||||
--> |
||||
<listener> |
||||
<listener-class>org.acegisecurity.ui.session.HttpSessionEventPublisher</listener-class> |
||||
</listener> |
||||
|
||||
<!-- |
||||
- Provides core MVC application controller. See contacts-servlet.xml. |
||||
--> |
||||
<servlet> |
||||
<servlet-name>contacts</servlet-name> |
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
||||
<load-on-startup>1</load-on-startup> |
||||
</servlet> |
||||
|
||||
<!-- |
||||
- Provides web services endpoint. See remoting-servlet.xml. |
||||
--> |
||||
<servlet> |
||||
<servlet-name>remoting</servlet-name> |
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
||||
<load-on-startup>2</load-on-startup> |
||||
</servlet> |
||||
|
||||
<servlet-mapping> |
||||
<servlet-name>contacts</servlet-name> |
||||
<url-pattern>*.htm</url-pattern> |
||||
</servlet-mapping> |
||||
|
||||
<servlet-mapping> |
||||
<servlet-name>remoting</servlet-name> |
||||
<url-pattern>/remoting/*</url-pattern> |
||||
</servlet-mapping> |
||||
|
||||
<welcome-file-list> |
||||
<welcome-file>index.jsp</welcome-file> |
||||
</welcome-file-list> |
||||
|
||||
<taglib> |
||||
<taglib-uri>/spring</taglib-uri> |
||||
<taglib-location>/WEB-INF/spring.tld</taglib-location> |
||||
</taglib> |
||||
|
||||
</web-app> |
||||
@ -1,46 +0,0 @@
@@ -1,46 +0,0 @@
|
||||
<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core' %> |
||||
<%@ page import="org.acegisecurity.ui.AbstractProcessingFilter" %> |
||||
<%@ page import="org.acegisecurity.ui.webapp.AuthenticationProcessingFilter" %> |
||||
<%@ page import="org.acegisecurity.AuthenticationException" %> |
||||
|
||||
<html> |
||||
<head> |
||||
<title>Login</title> |
||||
</head> |
||||
|
||||
<body> |
||||
<h1>Login</h1> |
||||
|
||||
<P>Valid users: |
||||
<P> |
||||
<P>username <b>marissa</b>, password <b>koala</b> |
||||
<P>username <b>dianne</b>, password <b>emu</b> |
||||
<p>username <b>scott</b>, password <b>wombat</b> |
||||
<p>username <b>peter</b>, password <b>opal</b> (user disabled) |
||||
<p>username <b>bill</b>, password <b>wombat</b> |
||||
<p>username <b>bob</b>, password <b>wombat</b> |
||||
<p>username <b>jane</b>, password <b>wombat</b> |
||||
<p> |
||||
|
||||
<%-- this form-login-page form is also used as the |
||||
form-error-page to ask for a login again. |
||||
--%> |
||||
<c:if test="${not empty param.login_error}"> |
||||
<font color="red"> |
||||
Your login attempt was not successful, try again.<BR><BR> |
||||
Reason: <%= ((AuthenticationException) session.getAttribute(AbstractProcessingFilter.ACEGI_SECURITY_LAST_EXCEPTION_KEY)).getMessage() %> |
||||
</font> |
||||
</c:if> |
||||
|
||||
<form action="<c:url value='j_acegi_security_check'/>" method="POST"> |
||||
<table> |
||||
<tr><td>User:</td><td><input type='text' name='j_username' <c:if test="${not empty param.login_error}">value='<c:out value="${ACEGI_SECURITY_LAST_USERNAME}"/></c:if>></td></tr> |
||||
<tr><td>Password:</td><td><input type='password' name='j_password'></td></tr> |
||||
<tr><td colspan='2'><input name="submit" type="submit"></td></tr> |
||||
<tr><td colspan='2'><input name="reset" type="reset"></td></tr> |
||||
</table> |
||||
|
||||
</form> |
||||
|
||||
</body> |
||||
</html> |
||||
@ -1,99 +0,0 @@
@@ -1,99 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'> |
||||
|
||||
<!-- |
||||
- Contacts web application |
||||
- |
||||
- web.xml for "x509" artifact only. |
||||
- |
||||
- $Id$ |
||||
--> |
||||
|
||||
<web-app> |
||||
|
||||
<display-name>Contacts Sample Application</display-name> |
||||
|
||||
<!-- |
||||
- Location of the XML file that defines the root application context |
||||
- Applied by ContextLoaderListener. |
||||
--> |
||||
<context-param> |
||||
<param-name>contextConfigLocation</param-name> |
||||
<param-value> |
||||
/WEB-INF/applicationContext-acegi-security.xml |
||||
classpath:applicationContext-common-business.xml |
||||
classpath:applicationContext-common-authorization.xml |
||||
</param-value> |
||||
</context-param> |
||||
<!-- |
||||
<context-param> |
||||
<param-name>log4jConfigLocation</param-name> |
||||
<param-value>/WEB-INF/classes/log4j.properties</param-value> |
||||
</context-param> |
||||
--> |
||||
|
||||
<filter> |
||||
<filter-name>Acegi Filter Chain Proxy</filter-name> |
||||
<filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class> |
||||
<init-param> |
||||
<param-name>targetClass</param-name> |
||||
<param-value>org.acegisecurity.util.FilterChainProxy</param-value> |
||||
</init-param> |
||||
</filter> |
||||
|
||||
<filter-mapping> |
||||
<filter-name>Acegi Filter Chain Proxy</filter-name> |
||||
<url-pattern>/*</url-pattern> |
||||
</filter-mapping> |
||||
|
||||
<!-- |
||||
- Loads the root application context of this web app at startup. |
||||
- The application context is then available via |
||||
- WebApplicationContextUtils.getWebApplicationContext(servletContext). |
||||
--> |
||||
<listener> |
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> |
||||
</listener> |
||||
<!-- |
||||
<listener> |
||||
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> |
||||
</listener> |
||||
--> |
||||
<!-- |
||||
- Provides core MVC application controller. See contacts-servlet.xml. |
||||
--> |
||||
<servlet> |
||||
<servlet-name>contacts</servlet-name> |
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
||||
<load-on-startup>1</load-on-startup> |
||||
</servlet> |
||||
|
||||
<!-- |
||||
- Provides web services endpoint. See remoting-servlet.xml. |
||||
--> |
||||
<servlet> |
||||
<servlet-name>remoting</servlet-name> |
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
||||
<load-on-startup>2</load-on-startup> |
||||
</servlet> |
||||
|
||||
<servlet-mapping> |
||||
<servlet-name>contacts</servlet-name> |
||||
<url-pattern>*.htm</url-pattern> |
||||
</servlet-mapping> |
||||
|
||||
<servlet-mapping> |
||||
<servlet-name>remoting</servlet-name> |
||||
<url-pattern>/remoting/*</url-pattern> |
||||
</servlet-mapping> |
||||
|
||||
<welcome-file-list> |
||||
<welcome-file>index.jsp</welcome-file> |
||||
</welcome-file-list> |
||||
|
||||
<taglib> |
||||
<taglib-uri>/spring</taglib-uri> |
||||
<taglib-location>/WEB-INF/spring.tld</taglib-location> |
||||
</taglib> |
||||
|
||||
</web-app> |
||||
Loading…
Reference in new issue