diff --git a/samples/contacts/war/WEB-INF/.cvsignore b/samples/contacts/src/main/webapp/common/WEB-INF/.cvsignore similarity index 100% rename from samples/contacts/war/WEB-INF/.cvsignore rename to samples/contacts/src/main/webapp/common/WEB-INF/.cvsignore diff --git a/samples/contacts/war/WEB-INF/caucho-servlet.xml b/samples/contacts/src/main/webapp/common/WEB-INF/caucho-servlet.xml similarity index 100% rename from samples/contacts/war/WEB-INF/caucho-servlet.xml rename to samples/contacts/src/main/webapp/common/WEB-INF/caucho-servlet.xml diff --git a/samples/contacts/war/WEB-INF/contacts-servlet.xml b/samples/contacts/src/main/webapp/common/WEB-INF/contacts-servlet.xml similarity index 100% rename from samples/contacts/war/WEB-INF/contacts-servlet.xml rename to samples/contacts/src/main/webapp/common/WEB-INF/contacts-servlet.xml diff --git a/samples/contacts/war/WEB-INF/jsp/add.jsp b/samples/contacts/src/main/webapp/common/WEB-INF/jsp/add.jsp similarity index 96% rename from samples/contacts/war/WEB-INF/jsp/add.jsp rename to samples/contacts/src/main/webapp/common/WEB-INF/jsp/add.jsp index 7df92b09b4..5b14a52275 100644 --- a/samples/contacts/war/WEB-INF/jsp/add.jsp +++ b/samples/contacts/src/main/webapp/common/WEB-INF/jsp/add.jsp @@ -1,40 +1,40 @@ -<%@ include file="/WEB-INF/jsp/include.jsp" %> - -
-
-
-
">Manage - - +<%@ include file="/WEB-INF/jsp/include.jsp" %> + + +
+
+
+
">Manage + + diff --git a/samples/contacts/war/WEB-INF/jsp/hello.jsp b/samples/contacts/src/main/webapp/common/WEB-INF/jsp/hello.jsp similarity index 97% rename from samples/contacts/war/WEB-INF/jsp/hello.jsp rename to samples/contacts/src/main/webapp/common/WEB-INF/jsp/hello.jsp index a532b4b1c1..f005fe6a19 100644 --- a/samples/contacts/war/WEB-INF/jsp/hello.jsp +++ b/samples/contacts/src/main/webapp/common/WEB-INF/jsp/hello.jsp @@ -1,32 +1,32 @@ -<%@ include file="/WEB-INF/jsp/include.jsp" %> - - -
This is a very simple application to demonstrate the Acegi Security System for Spring. -The application manages contacts, partitioned based on the user that owns them. -Users may only manage their own contacts, and only users with ROLE_SUPERVISOR -are allowed to delete their contacts. It also demonstrates how to configure -server-side secure objects so they can only be accessed via a public facade. - -
If you deployed the contacts-container-adapter.war file, the application -automatically extracts the principal from the web container (which should be -configured with a suitable Acegi Security System for Spring adapter). If -you're using the standard contacts.war file, the application is entirely -self-contained and you don't need to do anything special with your web -container. If you're using the contacts-cas.war file, please review the -setup in samples/contacts/etc/cas/applicationContext.xml for your CAS server -and if necessary rebuild using the Contacts application's build.xml. - -
This application also demonstrates a public method, which is used to select -the random contact that is shown below: -
-
-
-
-
">Manage -">Debug - - +<%@ include file="/WEB-INF/jsp/include.jsp" %> + + +
This is a very simple application to demonstrate the Acegi Security System for Spring. +The application manages contacts, partitioned based on the user that owns them. +Users may only manage their own contacts, and only users with ROLE_SUPERVISOR +are allowed to delete their contacts. It also demonstrates how to configure +server-side secure objects so they can only be accessed via a public facade. + +
If you deployed the contacts-container-adapter.war file, the application +automatically extracts the principal from the web container (which should be +configured with a suitable Acegi Security System for Spring adapter). If +you're using the standard contacts.war file, the application is entirely +self-contained and you don't need to do anything special with your web +container. If you're using the contacts-cas.war file, please review the +setup in samples/contacts/etc/cas/applicationContext.xml for your CAS server +and if necessary rebuild using the Contacts application's build.xml. + +
This application also demonstrates a public method, which is used to select +the random contact that is shown below: +
+
+
+
+
">Manage +">Debug + + diff --git a/samples/contacts/war/WEB-INF/jsp/include.jsp b/samples/contacts/src/main/webapp/common/WEB-INF/jsp/include.jsp similarity index 98% rename from samples/contacts/war/WEB-INF/jsp/include.jsp rename to samples/contacts/src/main/webapp/common/WEB-INF/jsp/include.jsp index 4968436528..96a45ec08f 100644 --- a/samples/contacts/war/WEB-INF/jsp/include.jsp +++ b/samples/contacts/src/main/webapp/common/WEB-INF/jsp/include.jsp @@ -1,5 +1,5 @@ -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="authz" uri="http://acegisecurity.sf.net/authz" %> - -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> -<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %> +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> +<%@ taglib prefix="authz" uri="http://acegisecurity.sf.net/authz" %> + +<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %> diff --git a/samples/contacts/war/WEB-INF/jsp/index.jsp b/samples/contacts/src/main/webapp/common/WEB-INF/jsp/index.jsp similarity index 96% rename from samples/contacts/war/WEB-INF/jsp/index.jsp rename to samples/contacts/src/main/webapp/common/WEB-INF/jsp/index.jsp index 76614c727a..64c6da5645 100644 --- a/samples/contacts/war/WEB-INF/jsp/index.jsp +++ b/samples/contacts/src/main/webapp/common/WEB-INF/jsp/index.jsp @@ -1,29 +1,29 @@ -<%@ include file="/WEB-INF/jsp/include.jsp" %> - - -
-
id | Name | ||
- |
-
- |
-
- |
-
">Logoff - - +<%@ include file="/WEB-INF/jsp/include.jsp" %> + + +
+
id | Name | ||
+ |
+
+ |
+
+ |
+
">Logoff
+
+
diff --git a/samples/contacts/war/WEB-INF/spring.tld b/samples/contacts/src/main/webapp/common/WEB-INF/spring.tld
similarity index 95%
rename from samples/contacts/war/WEB-INF/spring.tld
rename to samples/contacts/src/main/webapp/common/WEB-INF/spring.tld
index c526a55fcb..23427a7eb3 100644
--- a/samples/contacts/war/WEB-INF/spring.tld
+++ b/samples/contacts/src/main/webapp/common/WEB-INF/spring.tld
@@ -1,193 +1,193 @@
-
-
-
-
-
-<% if (context instanceof SecureContext) { %>
- The Context implements SecureContext.
-<% SecureContext sc = (SecureContext) context;
-
- Authentication auth = sc.getAuthentication();
- if (auth != null) { %>
- Authentication object is of type: <%= auth.getClass().getName() %>
- Authentication object as a String: <%= auth.toString() %>
-
- Authentication object holds the following granted authorities:
-<% GrantedAuthority[] granted = auth.getAuthorities();
- for (int i = 0; i < granted.length; i++) { %>
- <%= granted[i].toString() %> (getAuthority(): <%= granted[i].getAuthority() %>)
-<% }
-
- if (auth instanceof AuthByAdapter) { %>
-
SUCCESS! Your container adapter appears to be properly configured!
-<% } else { %>
-
SUCCESS! Your web filter appears to be properly configured!
-<% }
-
- } else { %>
- Authentication object is null.
- This is an error and your container adapter will not operate properly until corrected.
-<% }
- } else { %>
- ContextHolder does not contain a SecureContext.
- This is an error and your container adapter will not operate properly until corrected.
-<% }
-} else { %>
- ContextHolder on ContextHolder is null.
- This indicates improper setup of the container adapter. Refer to the reference documentation.
- Also ensure the correct subclass of AbstractMvcIntegrationInterceptor is being used for your container.
-<%}
-%>
-
+<%@ page import="net.sf.acegisecurity.context.Context" %>
+<%@ page import="net.sf.acegisecurity.context.ContextHolder" %>
+<%@ page import="net.sf.acegisecurity.context.SecureContext" %>
+<%@ page import="net.sf.acegisecurity.Authentication" %>
+<%@ page import="net.sf.acegisecurity.GrantedAuthority" %>
+<%@ page import="net.sf.acegisecurity.adapters.AuthByAdapter" %>
+
+<% Context context = ContextHolder.getContext();
+if (context != null) { %>
+ Context on ContextHolder is of type: <%= context.getClass().getName() %>
+
+<% if (context instanceof SecureContext) { %>
+ The Context implements SecureContext.
+<% SecureContext sc = (SecureContext) context;
+
+ Authentication auth = sc.getAuthentication();
+ if (auth != null) { %>
+ Authentication object is of type: <%= auth.getClass().getName() %>
+ Authentication object as a String: <%= auth.toString() %>
+
+ Authentication object holds the following granted authorities:
+<% GrantedAuthority[] granted = auth.getAuthorities();
+ for (int i = 0; i < granted.length; i++) { %>
+ <%= granted[i].toString() %> (getAuthority(): <%= granted[i].getAuthority() %>)
+<% }
+
+ if (auth instanceof AuthByAdapter) { %>
+
SUCCESS! Your container adapter appears to be properly configured!
+<% } else { %>
+
SUCCESS! Your web filter appears to be properly configured!
+<% }
+
+ } else { %>
+ Authentication object is null.
+ This is an error and your container adapter will not operate properly until corrected.
+<% }
+ } else { %>
+ ContextHolder does not contain a SecureContext.
+ This is an error and your container adapter will not operate properly until corrected.
+<% }
+} else { %>
+ ContextHolder on ContextHolder is null.
+ This indicates improper setup of the container adapter. Refer to the reference documentation.
+ Also ensure the correct subclass of AbstractMvcIntegrationInterceptor is being used for your container.
+<%}
+%>
+