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" %> - -Add New Contact - -

Add Contact

-
- - - - - - - - - - - - - - - -
Name: - "> - - -
Email: - "> - - -
-
- - Please fix all errors! - -

- -
-">Home - - +<%@ include file="/WEB-INF/jsp/include.jsp" %> + +Add New Contact + +

Add Contact

+
+ + + + + + + + + + + + + + + +
Name: + "> + + +
Email: + "> + + +
+
+ + Please fix all errors! + +

+ +
+">Home + + diff --git a/samples/contacts/war/WEB-INF/jsp/deleted.jsp b/samples/contacts/src/main/webapp/common/WEB-INF/jsp/deleted.jsp similarity index 94% rename from samples/contacts/war/WEB-INF/jsp/deleted.jsp rename to samples/contacts/src/main/webapp/common/WEB-INF/jsp/deleted.jsp index c68a207ae0..8fed87c4fd 100644 --- a/samples/contacts/war/WEB-INF/jsp/deleted.jsp +++ b/samples/contacts/src/main/webapp/common/WEB-INF/jsp/deleted.jsp @@ -1,13 +1,13 @@ -<%@ include file="/WEB-INF/jsp/include.jsp" %> - - -Deletion completed - -

Deleted

-

- - - -

">Manage - - +<%@ include file="/WEB-INF/jsp/include.jsp" %> + + +Deletion completed + +

Deleted

+

+ + + +

">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" %> - - -Contacts Security Demo - -

Contacts Security Demo

-

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" %> + + +Contacts Security Demo + +

Contacts Security Demo

+

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" %> - - -Your Contacts - -

's Contacts

-

- - - - - - - - - - - - -
idNameEmail
- - - - - - ">Del
-

">Add

">Logoff - - +<%@ include file="/WEB-INF/jsp/include.jsp" %> + + +Your Contacts + +

's Contacts

+

+ + + + + + + + + + + + +
idNameEmail
+ + + + + + ">Del
+

">Add

">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 @@ - - - - - - 1.0 - - 1.2 - - Spring - - http://www.springframework.org/tags - - Spring Framework JSP Tag Library. Authors: Rod Johnson, Juergen Hoeller - - - - htmlEscape - org.springframework.web.servlet.tags.HtmlEscapeTag - JSP - - - Sets default HTML escape value for the current page. - - - - defaultHtmlEscape - true - true - - - - - - - message - org.springframework.web.servlet.tags.MessageTag - JSP - - - Retrieves the message with the given code, or text if code isn't resolvable. - - - - code - false - true - - - - text - false - true - - - - htmlEscape - false - true - - - - - - - theme - org.springframework.web.servlet.tags.ThemeTag - JSP - - - Retrieves the theme message with the given code, or text if code isn't resolvable. - - - - code - false - true - - - - text - false - true - - - - htmlEscape - false - true - - - - - - - hasBindErrors - org.springframework.web.servlet.tags.BindErrorsTag - JSP - - - Provides Errors instance in case of bind errors. - - - - - errors - org.springframework.validation.Errors - - - - - name - true - true - - - - htmlEscape - false - true - - - - - - - bind - org.springframework.web.servlet.tags.BindTag - JSP - - - Provides BindStatus instance for certain bind path. - - - - - status - org.springframework.web.servlet.tags.BindStatus - - - - - path - true - true - - - - htmlEscape - false - true - - - - - - - transform - org.springframework.web.servlet.tags.TransformTag - JSP - - - Provides transformation of variables to Strings using appropriate - Custom Editor from BindTag (can only be used inside BindTag) - - - - value - true - true - - - - var - false - true - - - - scope - false - true - - - - htmlEscape - false - true - - - - - + + + + + + 1.0 + + 1.2 + + Spring + + http://www.springframework.org/tags + + Spring Framework JSP Tag Library. Authors: Rod Johnson, Juergen Hoeller + + + + htmlEscape + org.springframework.web.servlet.tags.HtmlEscapeTag + JSP + + + Sets default HTML escape value for the current page. + + + + defaultHtmlEscape + true + true + + + + + + + message + org.springframework.web.servlet.tags.MessageTag + JSP + + + Retrieves the message with the given code, or text if code isn't resolvable. + + + + code + false + true + + + + text + false + true + + + + htmlEscape + false + true + + + + + + + theme + org.springframework.web.servlet.tags.ThemeTag + JSP + + + Retrieves the theme message with the given code, or text if code isn't resolvable. + + + + code + false + true + + + + text + false + true + + + + htmlEscape + false + true + + + + + + + hasBindErrors + org.springframework.web.servlet.tags.BindErrorsTag + JSP + + + Provides Errors instance in case of bind errors. + + + + + errors + org.springframework.validation.Errors + + + + + name + true + true + + + + htmlEscape + false + true + + + + + + + bind + org.springframework.web.servlet.tags.BindTag + JSP + + + Provides BindStatus instance for certain bind path. + + + + + status + org.springframework.web.servlet.tags.BindStatus + + + + + path + true + true + + + + htmlEscape + false + true + + + + + + + transform + org.springframework.web.servlet.tags.TransformTag + JSP + + + Provides transformation of variables to Strings using appropriate + Custom Editor from BindTag (can only be used inside BindTag) + + + + value + true + true + + + + var + false + true + + + + scope + false + true + + + + htmlEscape + false + true + + + + + diff --git a/samples/contacts/war/index.jsp b/samples/contacts/src/main/webapp/common/index.jsp similarity index 97% rename from samples/contacts/war/index.jsp rename to samples/contacts/src/main/webapp/common/index.jsp index d724fd2101..4c86e33093 100644 --- a/samples/contacts/war/index.jsp +++ b/samples/contacts/src/main/webapp/common/index.jsp @@ -1,4 +1,4 @@ -<%@ include file="/WEB-INF/jsp/include.jsp" %> - -<%-- Redirected because we can't set the welcome page to a virtual URL. --%> - +<%@ include file="/WEB-INF/jsp/include.jsp" %> + +<%-- Redirected because we can't set the welcome page to a virtual URL. --%> + diff --git a/samples/contacts/war/logoff.jsp b/samples/contacts/src/main/webapp/common/logoff.jsp similarity index 96% rename from samples/contacts/war/logoff.jsp rename to samples/contacts/src/main/webapp/common/logoff.jsp index 6384a8a022..e59f80a705 100644 --- a/samples/contacts/war/logoff.jsp +++ b/samples/contacts/src/main/webapp/common/logoff.jsp @@ -1,3 +1,3 @@ -<%session.invalidate(); -response.sendRedirect("index.jsp"); +<%session.invalidate(); +response.sendRedirect("index.jsp"); %> \ No newline at end of file diff --git a/samples/contacts/war/secure/debug.jsp b/samples/contacts/src/main/webapp/common/secure/debug.jsp similarity index 97% rename from samples/contacts/war/secure/debug.jsp rename to samples/contacts/src/main/webapp/common/secure/debug.jsp index 47f12d3353..fb060eb19c 100644 --- a/samples/contacts/war/secure/debug.jsp +++ b/samples/contacts/src/main/webapp/common/secure/debug.jsp @@ -1,47 +1,47 @@ -<%@ 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.
-<%} -%> - +<%@ 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.
+<%} +%> +