");
+ Object lastException = request.getPortletSession().getAttribute(AbstractProcessingFilter.SPRING_SECURITY_LAST_EXCEPTION_KEY, PortletSession.APPLICATION_SCOPE);
+
+ if (lastException != null) {
+ out.println("Last Exception: " + lastException);
+ }
+ }
+}
diff --git a/samples/portlet/src/main/resources/applicationContext.xml b/samples/portlet/src/main/resources/applicationContext.xml
new file mode 100644
index 0000000000..f9dd69c3ed
--- /dev/null
+++ b/samples/portlet/src/main/resources/applicationContext.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+ messages
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ notAuthorized
+ notAvailable
+
+
+
+
+
diff --git a/samples/portlet/src/main/resources/log4j.properties b/samples/portlet/src/main/resources/log4j.properties
new file mode 100644
index 0000000000..9abc2b829b
--- /dev/null
+++ b/samples/portlet/src/main/resources/log4j.properties
@@ -0,0 +1,19 @@
+#log4j.debug=TRUE
+
+#log4j.rootLogger=FATAL, stdout
+#log4j.rootLogger=ERROR, stdout
+log4j.rootLogger=WARN, stdout
+#log4j.rootLogger=INFO, stdout
+#log4j.rootLogger=DEBUG, stdout
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
+
+# spring portlet mvc classes
+log4j.logger.org.springframework.web.portlet=INFO
+
+# spring portlet mvc sample classes
+log4j.logger.org.springframework.web.portlet.sample=DEBUG
+
+log4j.logger.org.springframework.security=DEBUG
\ No newline at end of file
diff --git a/samples/portlet/src/main/resources/messages.properties b/samples/portlet/src/main/resources/messages.properties
new file mode 100644
index 0000000000..b1742329c5
--- /dev/null
+++ b/samples/portlet/src/main/resources/messages.properties
@@ -0,0 +1,23 @@
+
+required=Required
+required.java.util.Date=A date of the form 'MM/dd/yyyy' is required
+
+typeMismatch=Invalid Data Entry
+typeMismatch.java.lang.Integer=Must be a number
+typeMismatch.java.util.Date=Must be of the form 'MM/dd/yyyy'
+
+button.home=Home
+button.edit=Edit
+
+exception.generalError.title=General Error
+
+exception.notAuthorized.title=Access Not Permitted
+exception.notAuthorized.message=You do not have permission to access this area.
+
+exception.notAvailable.title=Resource Not Available
+exception.notAvailable.message=That resource is not available.
+
+exception.contactAdmin=Please contact your System Administrator for assistance.
+
+portlet.exceptions.title=Sample Exceptions
+portlet.exceptions.message=This portlet lets you see what uncaught exceptions will look like in your portlet. Select one of the exceptions below in order to throw it.
diff --git a/samples/portlet/src/main/resources/messages_de.properties b/samples/portlet/src/main/resources/messages_de.properties
new file mode 100644
index 0000000000..3194b66f1f
--- /dev/null
+++ b/samples/portlet/src/main/resources/messages_de.properties
@@ -0,0 +1,15 @@
+
+# Apologies to those fluent in German -- these translations are straight from BabelFish and are only for demonstration purposes.
+
+exception.generalError.title=Allgemeine Störung
+
+exception.notAuthorized.title=Zugang Nicht Die Erlaubnis Gehabt
+exception.notAuthorized.message=Sie haben nicht Erlaubnis, diesen Bereich zugänglich zu machen.
+
+exception.notAvailable.title=Hilfsmittel Nicht Vorhanden
+exception.notAvailable.message=Dieses Hilfsmittel ist nicht vorhanden.
+
+exception.contactAdmin=Treten Sie bitte mit Ihrem Systemverwalter für Unterstützung in Verbindung.
+
+portlet.exceptions.title=Beispielausnahmen
+portlet.exceptions.message=Dieses portlet läßt Sie sehen, welche uncaught Ausnahmen wie in Ihrem portlet aussehen. Wählen Sie eine der Ausnahmen unten vor, um sie zu werfen.
diff --git a/samples/portlet/src/main/resources/portlet/securityContextPortlet.xml b/samples/portlet/src/main/resources/portlet/securityContextPortlet.xml
new file mode 100644
index 0000000000..eca0ef7525
--- /dev/null
+++ b/samples/portlet/src/main/resources/portlet/securityContextPortlet.xml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ tomcat
+ admin
+ manager
+
+ Administrator
+ Guest
+ User
+ Power User
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/portlet/src/main/webapp/WEB-INF/jsp/defError.jsp b/samples/portlet/src/main/webapp/WEB-INF/jsp/defError.jsp
new file mode 100644
index 0000000000..d38febcc7a
--- /dev/null
+++ b/samples/portlet/src/main/webapp/WEB-INF/jsp/defError.jsp
@@ -0,0 +1,10 @@
+<%@ include file="/WEB-INF/jsp/include.jsp" %>
+
+