You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2006/04/04 22:21:29 UTC

svn commit: r391397 - in /beehive/trunk/netui: src/pageflow/org/apache/beehive/netui/pageflow/PageFlowContextListener.java test/webapps/drt/web/WEB-INF/web.xml

Author: ekoneil
Date: Tue Apr  4 13:21:26 2006
New Revision: 391397

URL: http://svn.apache.org/viewcvs?rev=391397&view=rev
Log:
Add support for removing the NetUI and Struts attributes from the ServletContext in the PageFlowContextListener.

This coupled with the serialization fix to the PageFlowControlContainerImpl should fix the NPEs that can be seen from Struts when new .class files are picked up in a web application.

BB: self
Test: NetUI tests pass with this <listener> registered in web.xml


Modified:
    beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowContextListener.java
    beehive/trunk/netui/test/webapps/drt/web/WEB-INF/web.xml

Modified: beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowContextListener.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowContextListener.java?rev=391397&r1=391396&r2=391397&view=diff
==============================================================================
--- beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowContextListener.java (original)
+++ beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowContextListener.java Tue Apr  4 13:21:26 2006
@@ -17,8 +17,11 @@
  */
 package org.apache.beehive.netui.pageflow;
 
+import java.util.LinkedList;
+import java.util.Enumeration;
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
+import javax.servlet.ServletContext;
 
 import org.apache.beehive.netui.pageflow.internal.PageFlowInitialization;
 import org.apache.beehive.netui.util.logging.Logger;
@@ -33,15 +36,82 @@
     
     public void contextInitialized( ServletContextEvent event )
     {
-        LOG.info("In " + getClass().getName() + "; web application " +
-            event.getServletContext().getServletContextName() + " is being initialized");
+        LOG.info("In " +
+            getClass().getName() +
+            "; web application " +
+            event.getServletContext().getServletContextName() +
+            " is being initialized");
+
         PageFlowInitialization.performInitializations(event.getServletContext(), null);
     }
 
     public void contextDestroyed( ServletContextEvent event )
     {
-        LOG.info("In " + getClass().getName() + "; web application " +
-            event.getServletContext().getServletContextName() + " is being destroyed");
+        LOG.info("In " +
+            getClass().getName() +
+            "; web application " +
+            event.getServletContext().getServletContextName() +
+            " is being destroyed");
+
+        ServletContext servletContext = event.getServletContext();
+        removeAttributesNetUI(servletContext);
+        removeAttributesStruts(servletContext);
+    }
+
+    /**
+     * Remove the NetUI related attributes from the {@link ServletContext}.
+     *
+     * @param servletContext the servelt context
+     */
+    private void removeAttributesNetUI(ServletContext servletContext) {
+        try {
+            LinkedList list = new LinkedList();
+            Enumeration enumeration = servletContext.getAttributeNames();
+            while(enumeration.hasMoreElements()) {
+                String string = (String)enumeration.nextElement();
+                if(string.startsWith("_netui"))
+                    list.add(string);
+            }
+
+            for(int i = 0; i < list.size(); i++) {
+                Object key = list.get(i);
+                assert key != null;
+                assert key instanceof String;
+                LOG.trace("Removing ServletContext attribute named \"" + key + "\"");
+                servletContext.removeAttribute((String)key);
+            }
+        }
+        catch(Exception e) {
+            LOG.error("Caught error removing NetUI attribute from ServletContext.  Cause: " + e, e);
+        }
+    }
+
+    /**
+     * Remove the Struts related attributes from the {@link ServletContext}.
+     *
+     * @param servletContext the servlet context
+     */
+    private void removeAttributesStruts(ServletContext servletContext) {
+        try {
+            LinkedList list = new LinkedList();
+            Enumeration enumeration = servletContext.getAttributeNames();
+            while(enumeration.hasMoreElements()) {
+                String string = (String)enumeration.nextElement();
+                if(string.startsWith("org.apache.struts"))
+                    list.add(string);
+            }
+
+            for(int i = 0; i < list.size(); i++) {
+                Object key = list.get(i);
+                assert key != null;
+                assert key instanceof String;
+                LOG.trace("Removing ServletContext attribute named \"" + key + "\"");
+                servletContext.removeAttribute((String)key);
+            }
+        }
+        catch(Exception e) {
+            LOG.error("Caught error removing Struts attribute from ServletContext.  Cause: " + e, e);
+        }
     }
 }
 

Modified: beehive/trunk/netui/test/webapps/drt/web/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/test/webapps/drt/web/WEB-INF/web.xml?rev=391397&r1=391396&r2=391397&view=diff
==============================================================================
--- beehive/trunk/netui/test/webapps/drt/web/WEB-INF/web.xml (original)
+++ beehive/trunk/netui/test/webapps/drt/web/WEB-INF/web.xml Tue Apr  4 13:21:26 2006
@@ -7,94 +7,99 @@
 
     <!-- Make sure the secure forwards are turned on -->
     <context-param>
-       <param-name>jpf-secure-forwards</param-name>
-       <param-value>true</param-value>
+        <param-name>jpf-secure-forwards</param-name>
+        <param-value>true</param-value>
     </context-param>
+<!--
+    <listener>
+        <listener-class>org.apache.beehive.netui.pageflow.PageFlowContextListener</listener-class>
+    </listener>
+-->
+
+    <!-- Test Recorder Filter -->
+    <filter>
+        <filter-name>TestRecorderFilter</filter-name>
+        <filter-class>org.apache.beehive.netui.tools.testrecorder.server.TestRecorderFilter</filter-class>
+        <init-param>
+            <param-name>webapp</param-name>
+            <param-value>coreWeb</param-value>
+        </init-param>
+    </filter>
+
+    <filter>
+        <filter-name>PageFlowJspFilter</filter-name>
+        <filter-class>org.apache.beehive.netui.pageflow.PageFlowJspFilter</filter-class>
+    </filter>
+
+    <filter>
+        <filter-name>PageFlowFacesFilter</filter-name>
+        <filter-class>org.apache.beehive.netui.pageflow.PageFlowFacesFilter</filter-class>
+    </filter>
+
+    <filter-mapping>
+        <filter-name>TestRecorderFilter</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <filter-mapping>
+        <filter-name>PageFlowJspFilter</filter-name>
+        <url-pattern>*.jsp</url-pattern>
+        <dispatcher>FORWARD</dispatcher>
+        <dispatcher>REQUEST</dispatcher>
+        <dispatcher>INCLUDE</dispatcher>
+    </filter-mapping>
+
+    <filter-mapping>
+        <filter-name>PageFlowJspFilter</filter-name>
+        <url-pattern>*.jspx</url-pattern>
+        <dispatcher>FORWARD</dispatcher>
+        <dispatcher>REQUEST</dispatcher>
+        <dispatcher>INCLUDE</dispatcher>
+    </filter-mapping>
+
+    <filter-mapping>
+        <filter-name>PageFlowFacesFilter</filter-name>
+        <url-pattern>*.faces</url-pattern>
+        <dispatcher>FORWARD</dispatcher>
+        <dispatcher>REQUEST</dispatcher>
+        <dispatcher>INCLUDE</dispatcher>
+    </filter-mapping>
+
+    <filter-mapping>
+        <filter-name>PageFlowFacesFilter</filter-name>
+        <url-pattern>*.jsf</url-pattern>
+        <dispatcher>FORWARD</dispatcher>
+        <dispatcher>REQUEST</dispatcher>
+        <dispatcher>INCLUDE</dispatcher>
+    </filter-mapping>
+
+    <!-- Test Recorder Servlet (control channel) -->
+    <servlet>
+        <servlet-name>TestRecorderServlet</servlet-name>
+        <servlet-class>org.apache.beehive.netui.tools.testrecorder.server.TestRecorderServlet</servlet-class>
+    </servlet>
+
+    <!-- Struts Action Servlet / PageFlowController Configuration (with debugging) -->
+    <servlet>
+        <servlet-name>action</servlet-name>
+        <servlet-class>org.apache.beehive.netui.pageflow.DynamicSubappActionServlet</servlet-class>
+
+        <init-param>
+            <param-name>config</param-name>
+            <param-value>/_pageflow/struts-config.xml</param-value>
+        </init-param>
 
-  <!-- Test Recorder Filter -->
-  <filter>
-    <filter-name>TestRecorderFilter</filter-name>
-    <filter-class>org.apache.beehive.netui.tools.testrecorder.server.TestRecorderFilter</filter-class>
-      <init-param>
-          <param-name>webapp</param-name>
-          <param-value>coreWeb</param-value>
-      </init-param>
-  </filter>
-
-  <filter>
-    <filter-name>PageFlowJspFilter</filter-name>
-    <filter-class>org.apache.beehive.netui.pageflow.PageFlowJspFilter</filter-class>
-  </filter>
-
-  <filter>
-      <filter-name>PageFlowFacesFilter</filter-name>
-      <filter-class>org.apache.beehive.netui.pageflow.PageFlowFacesFilter</filter-class>
-  </filter>
-
-  <filter-mapping>
-    <filter-name>TestRecorderFilter</filter-name>
-    <url-pattern>/*</url-pattern>
-  </filter-mapping>
-
-  <filter-mapping>
-      <filter-name>PageFlowJspFilter</filter-name>
-      <url-pattern>*.jsp</url-pattern>
-      <dispatcher>FORWARD</dispatcher>
-      <dispatcher>REQUEST</dispatcher>
-      <dispatcher>INCLUDE</dispatcher>
-  </filter-mapping>
-
-  <filter-mapping>
-      <filter-name>PageFlowJspFilter</filter-name>
-      <url-pattern>*.jspx</url-pattern>
-      <dispatcher>FORWARD</dispatcher>
-      <dispatcher>REQUEST</dispatcher>
-      <dispatcher>INCLUDE</dispatcher>
-  </filter-mapping>
-
-  <filter-mapping>
-      <filter-name>PageFlowFacesFilter</filter-name>
-      <url-pattern>*.faces</url-pattern>
-      <dispatcher>FORWARD</dispatcher>
-      <dispatcher>REQUEST</dispatcher>
-      <dispatcher>INCLUDE</dispatcher>
-  </filter-mapping>
-
-  <filter-mapping>
-      <filter-name>PageFlowFacesFilter</filter-name>
-      <url-pattern>*.jsf</url-pattern>
-      <dispatcher>FORWARD</dispatcher>
-      <dispatcher>REQUEST</dispatcher>
-      <dispatcher>INCLUDE</dispatcher>
-  </filter-mapping>
-
-  <!-- Test Recorder Servlet (control channel) -->
-  <servlet>
-    <servlet-name>TestRecorderServlet</servlet-name>
-    <servlet-class>org.apache.beehive.netui.tools.testrecorder.server.TestRecorderServlet</servlet-class>
-  </servlet>
-
-  <!-- Struts Action Servlet / PageFlowController Configuration (with debugging) -->
-  <servlet>
-    <servlet-name>action</servlet-name>
-    <servlet-class>org.apache.beehive.netui.pageflow.DynamicSubappActionServlet</servlet-class>
-
-    <init-param>
-      <param-name>config</param-name>
-      <param-value>/_pageflow/struts-config.xml</param-value>
-    </init-param>
-
-    <!-- This is for miniTests/moduleConfigLocator.  The other one is in netui-config.xml. -->
-    <init-param>
-      <param-name>moduleConfigLocators</param-name>
-      <param-value>moduleConfigLocator.Locator2</param-value>
-    </init-param>
-
-         <!--
-            The <init-param> entry below is for Test13 which is a pure 100%
-            struts test.  The "application" param points to a properties file
-            that contains the tests error messages.  This is valid in struts.
-         -->
+        <!-- This is for miniTests/moduleConfigLocator.  The other one is in netui-config.xml. -->
+        <init-param>
+            <param-name>moduleConfigLocators</param-name>
+            <param-value>moduleConfigLocator.Locator2</param-value>
+        </init-param>
+
+        <!--
+           The <init-param> entry below is for Test13 which is a pure 100%
+           struts test.  The "application" param points to a properties file
+           that contains the tests error messages.  This is valid in struts.
+        -->
         <init-param>
             <param-name>application</param-name>
             <param-value>miscJpf.test13.test13</param-value>
@@ -111,189 +116,189 @@
             <param-name>config/miscJpf/test13</param-name>
             <param-value>/miscJpf/test13/struts-config-test13.xml</param-value>
         </init-param>
-    <load-on-startup>2</load-on-startup>
-  </servlet>
+        <load-on-startup>2</load-on-startup>
+    </servlet>
 
-  <!-- The XmlHttpRequest handler Servlet -->
-  <servlet>
-    <servlet-name>XmlHttpRequestServlet</servlet-name>
-    <servlet-class>org.apache.beehive.netui.pageflow.xmlhttprequest.XmlHttpRequestServlet</servlet-class>
-  </servlet>
-
-  <!-- The following servlet and servlet-mapping are for the ServletInclude test. -->
-  <servlet>
-    <servlet-name>IncludeJPF</servlet-name>
-    <servlet-class>miniTests.servletInclude.IncludeJPFServlet</servlet-class>
-  </servlet>
-  <servlet-mapping>
-    <servlet-name>IncludeJPF</servlet-name>
-    <url-pattern>/includejpf/*</url-pattern>
-  </servlet-mapping>
-
-  <!-- The following servlet and servlet-mapping are for the CreatePageFlow test. -->
-  <servlet>
-    <servlet-name>CreatePageFlow</servlet-name>
-    <servlet-class>miniTests.createPageFlow.CreatePageFlowServlet</servlet-class>
-  </servlet>
-  <servlet-mapping>
-    <servlet-name>CreatePageFlow</servlet-name>
-    <url-pattern>/createPageFlow/*</url-pattern>
-  </servlet-mapping>
-
-  <!-- Struts Action Servlet Mapping -->
-
-  <!-- Note that because Struts takes the *last* mapping here as the extension to add to
-       actions posted from forms, we must have *.do come after *.jpf. -->
-  <servlet-mapping>
-    <servlet-name>action</servlet-name>
-    <url-pattern>*.jpf</url-pattern>
-  </servlet-mapping>
-
-  <servlet-mapping>
-    <servlet-name>action</servlet-name>
-    <url-pattern>*.do</url-pattern>
-  </servlet-mapping>
-
-  <!-- XmlHttpRequest Servlet -->
-  <servlet-mapping>
-    <servlet-name>XmlHttpRequestServlet</servlet-name>
-    <url-pattern>*.xhr</url-pattern>
-  </servlet-mapping>
-
-  <servlet-mapping>
-    <servlet-name>XmlHttpRequestServlet</servlet-name>
-    <url-pattern>*.render</url-pattern>
-  </servlet-mapping>
-
-  <!-- TestRecorder Control Servlet -->
-  <servlet-mapping>
-    <servlet-name>TestRecorderServlet</servlet-name>
-    <url-pattern>/testRecorder</url-pattern>
-  </servlet-mapping>
-
-  <welcome-file-list>
-    <welcome-file>WelcomeFileController.jpf</welcome-file>
-    <welcome-file>index.jsp</welcome-file>
-  </welcome-file-list>
-
-  <error-page>
-    <error-code>500</error-code>
-    <location>/error.jsp</location>
-  </error-page>
+    <!-- The XmlHttpRequest handler Servlet -->
+    <servlet>
+        <servlet-name>XmlHttpRequestServlet</servlet-name>
+        <servlet-class>org.apache.beehive.netui.pageflow.xmlhttprequest.XmlHttpRequestServlet</servlet-class>
+    </servlet>
+
+    <!-- The following servlet and servlet-mapping are for the ServletInclude test. -->
+    <servlet>
+        <servlet-name>IncludeJPF</servlet-name>
+        <servlet-class>miniTests.servletInclude.IncludeJPFServlet</servlet-class>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>IncludeJPF</servlet-name>
+        <url-pattern>/includejpf/*</url-pattern>
+    </servlet-mapping>
+
+    <!-- The following servlet and servlet-mapping are for the CreatePageFlow test. -->
+    <servlet>
+        <servlet-name>CreatePageFlow</servlet-name>
+        <servlet-class>miniTests.createPageFlow.CreatePageFlowServlet</servlet-class>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>CreatePageFlow</servlet-name>
+        <url-pattern>/createPageFlow/*</url-pattern>
+    </servlet-mapping>
+
+    <!-- Struts Action Servlet Mapping -->
+
+    <!-- Note that because Struts takes the *last* mapping here as the extension to add to
+         actions posted from forms, we must have *.do come after *.jpf.
+      -->
+    <servlet-mapping>
+        <servlet-name>action</servlet-name>
+        <url-pattern>*.jpf</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>action</servlet-name>
+        <url-pattern>*.do</url-pattern>
+    </servlet-mapping>
+
+    <!-- XmlHttpRequest Servlet -->
+    <servlet-mapping>
+        <servlet-name>XmlHttpRequestServlet</servlet-name>
+        <url-pattern>*.xhr</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>XmlHttpRequestServlet</servlet-name>
+        <url-pattern>*.render</url-pattern>
+    </servlet-mapping>
+
+    <!-- TestRecorder Control Servlet -->
+    <servlet-mapping>
+        <servlet-name>TestRecorderServlet</servlet-name>
+        <url-pattern>/testRecorder</url-pattern>
+    </servlet-mapping>
+
+    <welcome-file-list>
+        <welcome-file>WelcomeFileController.jpf</welcome-file>
+        <welcome-file>index.jsp</welcome-file>
+    </welcome-file-list>
+
+    <error-page>
+        <error-code>500</error-code>
+        <location>/error.jsp</location>
+    </error-page>
 
     <jsp-config>
-      <!-- coreWeb: Mock Portal TLD -->
-      <taglib>
-          <taglib-uri>mockportal.tld</taglib-uri>
-          <taglib-location>/WEB-INF/mockportal.tld</taglib-location>
-      </taglib>
+        <!-- coreWeb: Mock Portal TLD -->
+        <taglib>
+            <taglib-uri>mockportal.tld</taglib-uri>
+            <taglib-location>/WEB-INF/mockportal.tld</taglib-location>
+        </taglib>
     </jsp-config>
 
-   <security-constraint>
-      <web-resource-collection>
-        <web-resource-name>Secure PageFlow - all</web-resource-name>
-        <url-pattern>/security/secure.do</url-pattern>
-        <url-pattern>/security/back_secure.do</url-pattern>
-      </web-resource-collection>
-      <user-data-constraint>
-         <transport-guarantee>CONFIDENTIAL</transport-guarantee>
-      </user-data-constraint>
-  </security-constraint>
-  <security-constraint>
-      <web-resource-collection>
-        <web-resource-name>Unsecure PageFlow - begin</web-resource-name>
-        <url-pattern>/security/unsecure.do</url-pattern>
-        <url-pattern>/security/back_unsecure.do</url-pattern>
-      </web-resource-collection>
-      <user-data-constraint>
-         <transport-guarantee>NONE</transport-guarantee>
-      </user-data-constraint>
-  </security-constraint>
-
-  <security-constraint>
-      <web-resource-collection>
-        <web-resource-name>miniTests-pageFlowUtils-secure</web-resource-name>
-        <url-pattern>/miniTests/pageFlowUtils/secure/*</url-pattern>
-        <url-pattern>/miniTests/pageFlowUtils/secureFoo.do</url-pattern>
-        <url-pattern>*.pageFlowUtilsSecure</url-pattern>
-      </web-resource-collection>
-      <user-data-constraint>
-         <transport-guarantee>CONFIDENTIAL</transport-guarantee>
-      </user-data-constraint>
-  </security-constraint>
-  <security-constraint>
-      <web-resource-collection>
-        <web-resource-name>miniTests-pageFlowUtils-unsecure</web-resource-name>
-        <url-pattern>/miniTests/pageFlowUtils/unsecure/*</url-pattern>
-        <url-pattern>/miniTests/pageFlowUtils/unsecureFoo.do</url-pattern>
-        <url-pattern>*.pageFlowUtilsUnsecure</url-pattern>
-      </web-resource-collection>
-      <user-data-constraint>
-         <transport-guarantee>NONE</transport-guarantee>
-      </user-data-constraint>
-  </security-constraint>
-
-  <security-constraint>
-      <web-resource-collection>
-        <web-resource-name>for SecureLinks test</web-resource-name>
-        <url-pattern>/tags/secureLinks/secure/*</url-pattern>
-        <url-pattern>/tags/secureLinks/linkToSecure/secureAction.do</url-pattern>
-      </web-resource-collection>
-      <user-data-constraint>
-         <transport-guarantee>CONFIDENTIAL</transport-guarantee>
-      </user-data-constraint>
-  </security-constraint>
-
-  <security-role>
-      <description>Test role for /miniTests/roles</description>
-      <role-name>GoodRole1</role-name>
-  </security-role>
-  <security-role>
-      <description>Test role for /miniTests/roles</description>
-      <role-name>GoodRole2</role-name>
-  </security-role>
-  <security-role>
-      <description>Test role for /miniTests/roles</description>
-      <role-name>BadRole</role-name>
-  </security-role>
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>Secure PageFlow - all</web-resource-name>
+            <url-pattern>/security/secure.do</url-pattern>
+            <url-pattern>/security/back_secure.do</url-pattern>
+        </web-resource-collection>
+        <user-data-constraint>
+            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+        </user-data-constraint>
+    </security-constraint>
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>Unsecure PageFlow - begin</web-resource-name>
+            <url-pattern>/security/unsecure.do</url-pattern>
+            <url-pattern>/security/back_unsecure.do</url-pattern>
+        </web-resource-collection>
+        <user-data-constraint>
+            <transport-guarantee>NONE</transport-guarantee>
+        </user-data-constraint>
+    </security-constraint>
 
-    <!-- Security constraints for the jpfSecurity tests -->
     <security-constraint>
-       <web-resource-collection>
-          <web-resource-name>Jpf Security on - filters</web-resource-name>
-          <url-pattern>/jpfSecurity/test1/secure1.do</url-pattern>
-          <url-pattern>/jpfSecurity/test2/secure1.do</url-pattern>
-          <url-pattern>/jpfSecurity/test3/secure1.do</url-pattern>
-          <url-pattern>/pageInput/test11/secure1.do</url-pattern>
-          <url-pattern>/miscJpf/bug38484/action1.do</url-pattern>
-          <url-pattern>/jpfScopedForms/test50/secure1.do</url-pattern>
-          <url-pattern>/resources/images/secureButton.jpg</url-pattern>
-          <url-pattern>/scopedJpf/jpfTest3/jpf1/begin.do</url-pattern>
-          <url-pattern>/scopedJpf/jpfTest3/jpf2/Jpf2.jpf</url-pattern>
-          <url-pattern>/singletonJpf/jpfTest9/jpf2/Jpf2.jpf</url-pattern>
-
-          </web-resource-collection>
-       <user-data-constraint>
-          <transport-guarantee>CONFIDENTIAL</transport-guarantee>
-       </user-data-constraint>
+        <web-resource-collection>
+            <web-resource-name>miniTests-pageFlowUtils-secure</web-resource-name>
+            <url-pattern>/miniTests/pageFlowUtils/secure/*</url-pattern>
+            <url-pattern>/miniTests/pageFlowUtils/secureFoo.do</url-pattern>
+            <url-pattern>*.pageFlowUtilsSecure</url-pattern>
+        </web-resource-collection>
+        <user-data-constraint>
+            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+        </user-data-constraint>
+    </security-constraint>
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>miniTests-pageFlowUtils-unsecure</web-resource-name>
+            <url-pattern>/miniTests/pageFlowUtils/unsecure/*</url-pattern>
+            <url-pattern>/miniTests/pageFlowUtils/unsecureFoo.do</url-pattern>
+            <url-pattern>*.pageFlowUtilsUnsecure</url-pattern>
+        </web-resource-collection>
+        <user-data-constraint>
+            <transport-guarantee>NONE</transport-guarantee>
+        </user-data-constraint>
     </security-constraint>
+
     <security-constraint>
-       <display-name>Security Constraints</display-name>
-       <web-resource-collection>
-          <web-resource-name>Jpf Security off - filters</web-resource-name>
-          <url-pattern>/jpfSecurity/test1/action2.do</url-pattern>
-          <url-pattern>/resources/jsp/done.jsp</url-pattern>
-          <url-pattern>/resources/jsp/error.jsp</url-pattern>
-          <url-pattern>/pageInput/test11/action2.do</url-pattern>
-          <url-pattern>/miscJpf/bug38484/action2.do</url-pattern>
-          <url-pattern>/jpfScopedForms/test50/action2.do</url-pattern>
-          <url-pattern>/scopedJpf/jpfTest3/jpf1/unsecure.do</url-pattern>
-          <url-pattern>/scopedJpf/jpfTest3/jpf2/unsecure.do</url-pattern>
-          <url-pattern>/singletonJpf/jpfTest9/jpf1/Jpf1.jpf</url-pattern>
-          </web-resource-collection>
-       <user-data-constraint>
-          <transport-guarantee>NONE</transport-guarantee>
-       </user-data-constraint>
+        <web-resource-collection>
+            <web-resource-name>for SecureLinks test</web-resource-name>
+            <url-pattern>/tags/secureLinks/secure/*</url-pattern>
+            <url-pattern>/tags/secureLinks/linkToSecure/secureAction.do</url-pattern>
+        </web-resource-collection>
+        <user-data-constraint>
+            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+        </user-data-constraint>
     </security-constraint>
 
+    <security-role>
+        <description>Test role for /miniTests/roles</description>
+        <role-name>GoodRole1</role-name>
+    </security-role>
+    <security-role>
+        <description>Test role for /miniTests/roles</description>
+        <role-name>GoodRole2</role-name>
+    </security-role>
+    <security-role>
+        <description>Test role for /miniTests/roles</description>
+        <role-name>BadRole</role-name>
+    </security-role>
+
+    <!-- Security constraints for the jpfSecurity tests -->
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>Jpf Security on - filters</web-resource-name>
+            <url-pattern>/jpfSecurity/test1/secure1.do</url-pattern>
+            <url-pattern>/jpfSecurity/test2/secure1.do</url-pattern>
+            <url-pattern>/jpfSecurity/test3/secure1.do</url-pattern>
+            <url-pattern>/pageInput/test11/secure1.do</url-pattern>
+            <url-pattern>/miscJpf/bug38484/action1.do</url-pattern>
+            <url-pattern>/jpfScopedForms/test50/secure1.do</url-pattern>
+            <url-pattern>/resources/images/secureButton.jpg</url-pattern>
+            <url-pattern>/scopedJpf/jpfTest3/jpf1/begin.do</url-pattern>
+            <url-pattern>/scopedJpf/jpfTest3/jpf2/Jpf2.jpf</url-pattern>
+            <url-pattern>/singletonJpf/jpfTest9/jpf2/Jpf2.jpf</url-pattern>
+
+        </web-resource-collection>
+        <user-data-constraint>
+            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+        </user-data-constraint>
+    </security-constraint>
+    <security-constraint>
+        <display-name>Security Constraints</display-name>
+        <web-resource-collection>
+            <web-resource-name>Jpf Security off - filters</web-resource-name>
+            <url-pattern>/jpfSecurity/test1/action2.do</url-pattern>
+            <url-pattern>/resources/jsp/done.jsp</url-pattern>
+            <url-pattern>/resources/jsp/error.jsp</url-pattern>
+            <url-pattern>/pageInput/test11/action2.do</url-pattern>
+            <url-pattern>/miscJpf/bug38484/action2.do</url-pattern>
+            <url-pattern>/jpfScopedForms/test50/action2.do</url-pattern>
+            <url-pattern>/scopedJpf/jpfTest3/jpf1/unsecure.do</url-pattern>
+            <url-pattern>/scopedJpf/jpfTest3/jpf2/unsecure.do</url-pattern>
+            <url-pattern>/singletonJpf/jpfTest9/jpf1/Jpf1.jpf</url-pattern>
+        </web-resource-collection>
+        <user-data-constraint>
+            <transport-guarantee>NONE</transport-guarantee>
+        </user-data-constraint>
+    </security-constraint>
 </web-app>