text:
package org.apache.tomcat.util.descriptor.web;

import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.digester.*;
import org.apache.tomcat.util.res.StringManager;
import org.xml.sax.Attributes;

import java.lang.reflect.Method;
import java.util.ArrayList;

/**
 *
RuleSet for processing the contents of a web application
 * deployment descriptor (/WEB-INF/web.xml) resource.

 *
 * @author Craig R. McClanahan
 */
public class WebRuleSet extends RuleSetBase {

    /**
     * The string resources for this package.
     */
    protected static final StringManager sm =
        StringManager.getManager(Constants.PACKAGE_NAME);

    // ----------------------------------------------------- Instance Variables

    /**
     * The matching pattern prefix to use for recognizing our elements.
     */
    protected final String prefix;

    /**
     * The full pattern matching prefix, including the webapp or web-fragment
     * component, to use for matching elements
     */
    protected final String fullPrefix;

    /**
     * Flag that indicates if this ruleset is for a web-fragment.xml file or for
     * a web.xml file.
     */
    protected final boolean fragment;

    /**
     * The SetSessionConfig rule used to parse the web.xml
     */
    protected final SetSessionConfig sessionConfig = new SetSessionConfig();

    /**
     * The SetLoginConfig rule used to parse the web.xml
     */
    protected final SetLoginConfig loginConfig = new SetLoginConfig();

    /**
     * The SetJspConfig rule used to parse the web.xml
     */
    protected final SetJspConfig jspConfig = new SetJspConfig();

    /**
     * The NameRule rule used to parse the web.xml
     */
    protected final NameRule name = new NameRule();

    /**
     * The AbsoluteOrderingRule rule used to parse the web.xml
     */
    protected final AbsoluteOrderingRule absoluteOrdering;

    /**
     * The RelativeOrderingRule rule used to parse the web.xml
     */
    protected final RelativeOrderingRule relativeOrdering;

    // ------------------------------------------------------------ Constructor

    /**
     * Construct an instance of this RuleSet with the default
     * matching pattern prefix and default fragment setting.
     */
    public WebRuleSet() {

        this("", false);

    }

    /**
     * Construct an instance of this RuleSet with the default
     * matching pattern prefix.
     */
    public WebRuleSet(boolean fragment) {

        this("", fragment);

    }

    /**
     * Construct an instance of this RuleSet with the specified
     * matching pattern prefix.
     *
     * @param prefix Prefix for matching pattern rules (including the
     *  trailing slash character)
     */
    public WebRuleSet(String prefix, boolean fragment) {

        super();
        this.namespaceURI = null;
        this.prefix = prefix;
        this.fragment = fragment;

        if(fragment) {
            fullPrefix = prefix + "web-fragment";
        } else {
            fullPrefix = prefix + "web-app";
        }

        absoluteOrdering = new AbsoluteOrderingRule(fragment);
        relativeOrdering = new RelativeOrderingRule(fragment);
    }

    // --------------------------------------------------------- Public Methods

    /**
     *
Add the set of Rule instances defined in this RuleSet to the
     * specified Digester instance, associating them with
     * our namespace URI (if any).  This method should only be called
     * by a Digester instance.

     *
     * @param digester Digester instance to which the new Rule instances
     *  should be added.
     */
    @Override
    public void addRuleInstances(Digester digester) {
        digester.addRule(fullPrefix,
                         new SetPublicIdRule("setPublicId"));
        digester.addRule(fullPrefix,
                         new IgnoreAnnotationsRule());
        digester.addRule(fullPrefix,
                new VersionRule());

        // Required for both fragments and non-fragments
        digester.addRule(fullPrefix + "/absolute-ordering", absoluteOrdering);
        digester.addRule(fullPrefix + "/ordering", relativeOrdering);

        if (fragment) {
            // web-fragment.xml
            digester.addRule(fullPrefix + "/name", name);
            digester.addCallMethod(fullPrefix + "/ordering/after/name",
                                   "addAfterOrdering", 0);
            digester.addCallMethod(fullPrefix + "/ordering/after/others",
                                   "addAfterOrderingOthers");
            digester.addCallMethod(fullPrefix + "/ordering/before/name",
                                   "addBeforeOrdering", 0);
            digester.addCallMethod(fullPrefix + "/ordering/before/others",
                                   "addBeforeOrderingOthers");
        } else {
            // web.xml
            digester.addCallMethod(fullPrefix + "/absolute-ordering/name",
                                   "addAbsoluteOrdering", 0);
            digester.addCallMethod(fullPrefix + "/absolute-ordering/others",
                                   "addAbsoluteOrderingOthers");
            digester.addRule(fullPrefix + "/deny-uncovered-http-methods",
                    new SetDenyUncoveredHttpMethodsRule());
        }

        digester.addCallMethod(fullPrefix + "/context-param",
                               "addContextParam", 2);
        digester.addCallParam(fullPrefix + "/context-param/param-name", 0);
        digester.addCallParam(fullPrefix + "/context-param/param-value", 1);

        digester.addCallMethod(fullPrefix + "/display-name",
                               "setDisplayName", 0);

        digester.addRule(fullPrefix + "/distributable",
                         new SetDistributableRule());

        configureNamingRules(digester);

        digester.addObjectCreate(fullPrefix + "/error-page",
                                 "org.apache.tomcat.util.descriptor.web.ErrorPage");
        digester.addSetNext(fullPrefix + "/error-page",
                            "addErrorPage",
                            "org.apache.tomcat.util.descriptor.web.ErrorPage");

        digester.addCallMethod(fullPrefix + "/error-page/error-code",
                               "setErrorCode", 0);
        digester.addCallMethod(fullPrefix + "/error-page/exception-type",
                               "setExceptionType", 0);
        digester.addCallMethod(fullPrefix + "/error-page/location",
                               "setLocation", 0);

        digester.addObjectCreate(fullPrefix + "/filter",
                                 "org.apache.tomcat.util.descriptor.web.FilterDef");
        digester.addSetNext(fullPrefix + "/filter",
                            "addFilter",
                            "org.apache.tomcat.util.descriptor.web.FilterDef");

        digester.addCallMethod(fullPrefix + "/filter/description",
                               "setDescription", 0);
        digester.addCallMethod(fullPrefix + "/filter/display-name",
                               "setDisplayName", 0);
        digester.addCallMethod(fullPrefix + "/filter/filter-class",
                               "setFilterClass", 0);
        digester.addCallMethod(fullPrefix + "/filter/filter-name",
                               "setFilterName", 0);
        digester.addCallMethod(fullPrefix + "/filter/icon/large-icon",
                               "setLargeIcon", 0);
        digester.addCallMethod(fullPrefix + "/filter/icon/small-icon",
                               "setSmallIcon", 0);
        digester.addCallMethod(fullPrefix + "/filter/async-supported",
                "setAsyncSupported", 0);

        digester.addCallMethod(fullPrefix + "/filter/init-param",
                               "addInitParameter", 2);
        digester.addCallParam(fullPrefix + "/filter/init-param/param-name",
                              0);
        digester.addCallParam(fullPrefix + "/filter/init-param/param-value",
                              1);

        digester.addObjectCreate(fullPrefix + "/filter-mapping",
                                 "org.apache.tomcat.util.descriptor.web.FilterMap");
        digester.addSetNext(fullPrefix + "/filter-mapping",
                                 "addFilterMapping",
                                 "org.apache.tomcat.util.descriptor.web.FilterMap");

        digester.addCallMethod(fullPrefix + "/filter-mapping/filter-name",
                               "setFilterName", 0);
        digester.addCallMethod(fullPrefix + "/filter-mapping/servlet-name",
                               "addServletName", 0);
        digester.addCallMethod(fullPrefix + "/filter-mapping/url-pattern",
                               "addURLPattern", 0);

        digester.addCallMethod(fullPrefix + "/filter-mapping/dispatcher",
                               "setDispatcher", 0);

         digester.addCallMethod(fullPrefix + "/listener/listener-class",
                                "addListener", 0);

        digester.addRule(fullPrefix + "/jsp-config",
                         jspConfig);

        digester.addObjectCreate(fullPrefix + "/jsp-config/jsp-property-group",
                                 "org.apache.tomcat.util.descriptor.web.JspPropertyGroup");
        digester.addSetNext(fullPrefix + "/jsp-config/jsp-property-group",
                            "addJspPropertyGroup",
                            "org.apache.tomcat.util.descriptor.web.JspPropertyGroup");
        digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/deferred-syntax-allowed-as-literal",
                               "setDeferredSyntax", 0);
        digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/el-ignored",
                               "setElIgnored", 0);
        digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/include-coda",
                               "addIncludeCoda", 0);
        digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/include-prelude",
                               "addIncludePrelude", 0);
        digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/is-xml",
                               "setIsXml", 0);
        digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/page-encoding",
                               "setPageEncoding", 0);
        digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/scripting-invalid",
                               "setScriptingInvalid", 0);
        digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/trim-directive-whitespaces",
                               "setTrimWhitespace", 0);
        digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/url-pattern",
                               "addUrlPattern", 0);
        digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/default-content-type",
                               "setDefaultContentType", 0);
        digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/buffer",
                               "setBuffer", 0);
        digester.addCallMethod(fullPrefix + "/jsp-config/jsp-property-group/error-on-undeclared-namespace",
                               "setErrorOnUndeclaredNamespace", 0);

        digester.addRule(fullPrefix + "/login-config",
                         loginConfig);

        digester.addObjectCreate(fullPrefix + "/login-config",
                                 "org.apache.tomcat.util.descriptor.web.LoginConfig");
        digester.addSetNext(fullPrefix + "/login-config",
                            "setLoginConfig",
                            "org.apache.tomcat.util.descriptor.web.LoginConfig");

        digester.addCallMethod(fullPrefix + "/login-config/auth-method",
                               "setAuthMethod", 0);
        digester.addCallMethod(fullPrefix + "/login-config/realm-name",
                               "setRealmName", 0);
        digester.addCallMethod(fullPrefix + "/login-config/form-login-config/form-error-page",
                               "setErrorPage", 0);
        digester.addCallMethod(fullPrefix + "/login-config/form-login-config/form-login-page",
                               "setLoginPage", 0);

        digester.addCallMethod(fullPrefix + "/mime-mapping",
                               "addMimeMapping", 2);
        digester.addCallParam(fullPrefix + "/mime-mapping/extension", 0);
        digester.addCallParam(fullPrefix + "/mime-mapping/mime-type", 1);

        digester.addObjectCreate(fullPrefix + "/security-constraint",
                                 "org.apache.tomcat.util.descriptor.web.SecurityConstraint");
        digester.addSetNext(fullPrefix + "/security-constraint",
                            "addSecurityConstraint",
                            "org.apache.tomcat.util.descriptor.web.SecurityConstraint");

        digester.addRule(fullPrefix + "/security-constraint/auth-constraint",
                         new SetAuthConstraintRule());
        digester.addCallMethod(fullPrefix + "/security-constraint/auth-constraint/role-name",
                               "addAuthRole", 0);
        digester.addCallMethod(fullPrefix + "/security-constraint/display-name",
                               "setDisplayName", 0);
        digester.addCallMethod(fullPrefix + "/security-constraint/user-data-constraint/transport-guarantee",
                               "setUserConstraint", 0);

        digester.addObjectCreate(fullPrefix + "/security-constraint/web-resource-collection",
                                 "org.apache.tomcat.util.descriptor.web.SecurityCollection");
        digester.addSetNext(fullPrefix + "/security-constraint/web-resource-collection",
                            "addCollection",
                            "org.apache.tomcat.util.descriptor.web.SecurityCollection");
        digester.addCallMethod(fullPrefix + "/security-constraint/web-resource-collection/http-method",
                               "addMethod", 0);
        digester.addCallMethod(fullPrefix + "/security-constraint/web-resource-collection/http-method-omission",
                               "addOmittedMethod", 0);
        digester.addCallMethod(fullPrefix + "/security-constraint/web-resource-collection/url-pattern",
                               "addPattern", 0);
        digester.addCallMethod(fullPrefix + "/security-constraint/web-resource-collection/web-resource-name",
                               "setName", 0);

        digester.addCallMethod(fullPrefix + "/security-role/role-name",
                               "addSecurityRole", 0);

        digester.addRule(fullPrefix + "/servlet",
                         new ServletDefCreateRule());
        digester.addSetNext(fullPrefix + "/servlet",
                            "addServlet",
                            "org.apache.tomcat.util.descriptor.web.ServletDef");

        digester.addCallMethod(fullPrefix + "/servlet/init-param",
                               "addInitParameter", 2);
        digester.addCallParam(fullPrefix + "/servlet/init-param/param-name",
                              0);
        digester.addCallParam(fullPrefix + "/servlet/init-param/param-value",
                              1);

        digester.addCallMethod(fullPrefix + "/servlet/jsp-file",
                               "setJspFile", 0);
        digester.addCallMethod(fullPrefix + "/servlet/load-on-startup",
                               "setLoadOnStartup", 0);
        digester.addCallMethod(fullPrefix + "/servlet/run-as/role-name",
                               "setRunAs", 0);

        digester.addObjectCreate(fullPrefix + "/servlet/security-role-ref",
                                 "org.apache.tomcat.util.descriptor.web.SecurityRoleRef");
        digester.addSetNext(fullPrefix + "/servlet/security-role-ref",
                            "addSecurityRoleRef",
                            "org.apache.tomcat.util.descriptor.web.SecurityRoleRef");
        digester.addCallMethod(fullPrefix + "/servlet/security-role-ref/role-link",
                               "setLink", 0);
        digester.addCallMethod(fullPrefix + "/servlet/security-role-ref/role-name",
                               "setName", 0);

        digester.addCallMethod(fullPrefix + "/servlet/servlet-class",
                              "setServletClass", 0);
        digester.addCallMethod(fullPrefix + "/servlet/servlet-name",
                              "setServletName", 0);

        digester.addObjectCreate(fullPrefix + "/servlet/multipart-config",
                                 "org.apache.tomcat.util.descriptor.web.MultipartDef");
        digester.addSetNext(fullPrefix + "/servlet/multipart-config",
                            "setMultipartDef",
                            "org.apache.tomcat.util.descriptor.web.MultipartDef");
        digester.addCallMethod(fullPrefix + "/servlet/multipart-config/location",
                               "setLocation", 0);
        digester.addCallMethod(fullPrefix + "/servlet/multipart-config/max-file-size",
                               "setMaxFileSize", 0);
        digester.addCallMethod(fullPrefix + "/servlet/multipart-config/max-request-size",
                               "setMaxRequestSize", 0);
        digester.addCallMethod(fullPrefix + "/servlet/multipart-config/file-size-threshold",
                               "setFileSizeThreshold", 0);

        digester.addCallMethod(fullPrefix + "/servlet/async-supported",
                               "setAsyncSupported", 0);
        digester.addCallMethod(fullPrefix + "/servlet/enabled",
                               "setEnabled", 0);

        digester.addRule(fullPrefix + "/servlet-mapping",
                               new CallMethodMultiRule("addServletMapping", 2, 0));
        digester.addCallParam(fullPrefix + "/servlet-mapping/servlet-name", 1);
        digester.addRule(fullPrefix + "/servlet-mapping/url-pattern", new CallParamMultiRule(0));

        digester.addRule(fullPrefix + "/session-config", sessionConfig);
        digester.addObjectCreate(fullPrefix + "/session-config",
                                 "org.apache.tomcat.util.descriptor.web.SessionConfig");
        digester.addSetNext(fullPrefix + "/session-config", "setSessionConfig",
                            "org.apache.tomcat.util.descriptor.web.SessionConfig");
        digester.addCallMethod(fullPrefix + "/session-config/session-timeout",
                               "setSessionTimeout", 0);
        digester.addCallMethod(fullPrefix + "/session-config/cookie-config/name",
                               "setCookieName", 0);
        digester.addCallMethod(fullPrefix + "/session-config/cookie-config/domain",
                               "setCookieDomain", 0);
        digester.addCallMethod(fullPrefix + "/session-config/cookie-config/path",
                               "setCookiePath", 0);
        digester.addCallMethod(fullPrefix + "/session-config/cookie-config/comment",
                               "setCookieComment", 0);
        digester.addCallMethod(fullPrefix + "/session-config/cookie-config/http-only",
                               "setCookieHttpOnly", 0);
        digester.addCallMethod(fullPrefix + "/session-config/cookie-config/secure",
                               "setCookieSecure", 0);
        digester.addCallMethod(fullPrefix + "/session-config/cookie-config/max-age",
                               "setCookieMaxAge", 0);
        digester.addCallMethod(fullPrefix + "/session-config/tracking-mode",
                               "addSessionTrackingMode", 0);

        // Taglibs pre Servlet 2.4
        digester.addRule(fullPrefix + "/taglib", new TaglibLocationRule(false));
        digester.addCallMethod(fullPrefix + "/taglib",
                               "addTaglib", 2);
        digester.addCallParam(fullPrefix + "/taglib/taglib-location", 1);
        digester.addCallParam(fullPrefix + "/taglib/taglib-uri", 0);

        // Taglibs Servlet 2.4 onwards
        digester.addRule(fullPrefix + "/jsp-config/taglib", new TaglibLocationRule(true));
        digester.addCallMethod(fullPrefix + "/jsp-config/taglib",
                "addTaglib", 2);
        digester.addCallParam(fullPrefix + "/jsp-config/taglib/taglib-location", 1);
        digester.addCallParam(fullPrefix + "/jsp-config/taglib/taglib-uri", 0);

        digester.addCallMethod(fullPrefix + "/welcome-file-list/welcome-file",
                               "addWelcomeFile", 0);

        digester.addCallMethod(fullPrefix + "/locale-encoding-mapping-list/locale-encoding-mapping",
                              "addLocaleEncodingMapping", 2);
        digester.addCallParam(fullPrefix + "/locale-encoding-mapping-list/locale-encoding-mapping/locale", 0);
        digester.addCallParam(fullPrefix + "/locale-encoding-mapping-list/locale-encoding-mapping/encoding", 1);

        digester.addRule(fullPrefix + "/post-construct",
                new LifecycleCallbackRule("addPostConstructMethods", 2, true));
        digester.addCallParam(fullPrefix + "/post-construct/lifecycle-callback-class", 0);
        digester.addCallParam(fullPrefix + "/post-construct/lifecycle-callback-method", 1);

        digester.addRule(fullPrefix + "/pre-destroy",
                new LifecycleCallbackRule("addPreDestroyMethods", 2, false));
        digester.addCallParam(fullPrefix + "/pre-destroy/lifecycle-callback-class", 0);
        digester.addCallParam(fullPrefix + "/pre-destroy/lifecycle-callback-method", 1);
    }

    protected void configureNamingRules(Digester digester) {
        //ejb-local-ref
        digester.addObjectCreate(fullPrefix + "/ejb-local-ref",
                                 "org.apache.tomcat.util.descriptor.web.ContextLocalEjb");
        digester.addSetNext(fullPrefix + "/ejb-local-ref",
                            "addEjbLocalRef",
                            "org.apache.tomcat.util.descriptor.web.ContextLocalEjb");
        digester.addCallMethod(fullPrefix + "/ejb-local-ref/description",
                               "setDescription", 0);
        digester.addCallMethod(fullPrefix + "/ejb-local-ref/ejb-link",
                               "setLink", 0);
        digester.addCallMethod(fullPrefix + "/ejb-local-ref/ejb-ref-name",
                               "setName", 0);
        digester.addCallMethod(fullPrefix + "/ejb-local-ref/ejb-ref-type",
                               "setType", 0);
        digester.addCallMethod(fullPrefix + "/ejb-local-ref/local",
                               "setLocal", 0);
        digester.addCallMethod(fullPrefix + "/ejb-local-ref/local-home",
                               "setHome", 0);
        digester.addRule(fullPrefix + "/ejb-local-ref/mapped-name",
                         new MappedNameRule());
        configureInjectionRules(digester, "web-app/ejb-local-ref/");

        //ejb-ref
        digester.addObjectCreate(fullPrefix + "/ejb-ref",
                                 "org.apache.tomcat.util.descriptor.web.ContextEjb");
        digester.addSetNext(fullPrefix + "/ejb-ref",
                            "addEjbRef",
                            "org.apache.tomcat.util.descriptor.web.ContextEjb");
        digester.addCallMethod(fullPrefix + "/ejb-ref/description",
                               "setDescription", 0);
        digester.addCallMethod(fullPrefix + "/ejb-ref/ejb-link",
                               "setLink", 0);
        digester.addCallMethod(fullPrefix + "/ejb-ref/ejb-ref-name",
                               "setName", 0);
        digester.addCallMethod(fullPrefix + "/ejb-ref/ejb-ref-type",
                               "setType", 0);
        digester.addCallMethod(fullPrefix + "/ejb-ref/home",
                               "setHome", 0);
        digester.addCallMethod(fullPrefix + "/ejb-ref/remote",
                               "setRemote", 0);
        digester.addRule(fullPrefix + "/ejb-ref/mapped-name",
                         new MappedNameRule());
        configureInjectionRules(digester, "web-app/ejb-ref/");

        //env-entry
        digester.addObjectCreate(fullPrefix + "/env-entry",
                                 "org.apache.tomcat.util.descriptor.web.ContextEnvironment");
        digester.addSetNext(fullPrefix + "/env-entry",
                            "addEnvEntry",
                            "org.apache.tomcat.util.descriptor.web.ContextEnvironment");
        digester.addRule(fullPrefix + "/env-entry", new SetOverrideRule());
        digester.addCallMethod(fullPrefix + "/env-entry/description",
                               "setDescription", 0);
        digester.addCallMethod(fullPrefix + "/env-entry/env-entry-name",
                               "setName", 0);
        digester.addCallMethod(fullPrefix + "/env-entry/env-entry-type",
                               "setType", 0);
        digester.addCallMethod(fullPrefix + "/env-entry/env-entry-value",
                               "setValue", 0);
        digester.addRule(fullPrefix + "/env-entry/mapped-name",
                         new MappedNameRule());
        configureInjectionRules(digester, "web-app/env-entry/");

        //resource-env-ref
        digester.addObjectCreate(fullPrefix + "/resource-env-ref",
            "org.apache.tomcat.util.descriptor.web.ContextResourceEnvRef");
        digester.addSetNext(fullPrefix + "/resource-env-ref",
                            "addResourceEnvRef",
                            "org.apache.tomcat.util.descriptor.web.ContextResourceEnvRef");
        digester.addCallMethod(fullPrefix + "/resource-env-ref/resource-env-ref-name",
                "setName", 0);
        digester.addCallMethod(fullPrefix + "/resource-env-ref/resource-env-ref-type",
                "setType", 0);
        digester.addRule(fullPrefix + "/resource-env-ref/mapped-name",
                         new MappedNameRule());
        configureInjectionRules(digester, "web-app/resource-env-ref/");

        //message-destination
        digester.addObjectCreate(fullPrefix + "/message-destination",
                                 "org.apache.tomcat.util.descriptor.web.MessageDestination");
        digester.addSetNext(fullPrefix + "/message-destination",
                            "addMessageDestination",
                            "org.apache.tomcat.util.descriptor.web.MessageDestination");
        digester.addCallMethod(fullPrefix + "/message-destination/description",
                               "setDescription", 0);
        digester.addCallMethod(fullPrefix + "/message-destination/display-name",
                               "setDisplayName", 0);
        digester.addCallMethod(fullPrefix + "/message-destination/icon/large-icon",
                               "setLargeIcon", 0);
        digester.addCallMethod(fullPrefix + "/message-destination/icon/small-icon",
                               "setSmallIcon", 0);
        digester.addCallMethod(fullPrefix + "/message-destination/message-destination-name",
                               "setName", 0);
        digester.addRule(fullPrefix + "/message-destination/mapped-name",
                         new MappedNameRule());

        //message-destination-ref
        digester.addObjectCreate(fullPrefix + "/message-destination-ref",
                                 "org.apache.tomcat.util.descriptor.web.MessageDestinationRef");
        digester.addSetNext(fullPrefix + "/message-destination-ref",
                            "addMessageDestinationRef",
                            "org.apache.tomcat.util.descriptor.web.MessageDestinationRef");
        digester.addCallMethod(fullPrefix + "/message-destination-ref/description",
                               "setDescription", 0);
        digester.addCallMethod(fullPrefix + "/message-destination-ref/message-destination-link",
                               "setLink", 0);
        digester.addCallMethod(fullPrefix + "/message-destination-ref/message-destination-ref-name",
                               "setName", 0);
        digester.addCallMethod(fullPrefix + "/message-destination-ref/message-destination-type",
                               "setType", 0);
        digester.addCallMethod(fullPrefix + "/message-destination-ref/message-destination-usage",
                               "setUsage", 0);
        digester.addRule(fullPrefix + "/message-destination-ref/mapped-name",
                         new MappedNameRule());
        configureInjectionRules(digester, "web-app/message-destination-ref/");

        //resource-ref
        digester.addObjectCreate(fullPrefix + "/resource-ref",
                                 "org.apache.tomcat.util.descriptor.web.ContextResource");
        digester.addSetNext(fullPrefix + "/resource-ref",
                            "addResourceRef",
                            "org.apache.tomcat.util.descriptor.web.ContextResource");
        digester.addCallMethod(fullPrefix + "/resource-ref/description",
                               "setDescription", 0);
        digester.addCallMethod(fullPrefix + "/resource-ref/res-auth",
                               "setAuth", 0);
        digester.addCallMethod(fullPrefix + "/resource-ref/res-ref-name",
                               "setName", 0);
        digester.addCallMethod(fullPrefix + "/resource-ref/res-sharing-scope",
                               "setScope", 0);
        digester.addCallMethod(fullPrefix + "/resource-ref/res-type",
                               "setType", 0);
        digester.addRule(fullPrefix + "/resource-ref/mapped-name",
                         new MappedNameRule());
        configureInjectionRules(digester, "web-app/resource-ref/");

        //service-ref
        digester.addObjectCreate(fullPrefix + "/service-ref",
                                 "org.apache.tomcat.util.descriptor.web.ContextService");
        digester.addSetNext(fullPrefix + "/service-ref",
                            "addServiceRef",
                            "org.apache.tomcat.util.descriptor.web.ContextService");
        digester.addCallMethod(fullPrefix + "/service-ref/description",
                               "setDescription", 0);
        digester.addCallMethod(fullPrefix + "/service-ref/display-name",
                               "setDisplayname", 0);
        digester.addCallMethod(fullPrefix + "/service-ref/icon/large-icon",
                               "setLargeIcon", 0);
        digester.addCallMethod(fullPrefix + "/service-ref/icon/small-icon",
                               "setSmallIcon", 0);
        digester.addCallMethod(fullPrefix + "/service-ref/service-ref-name",
                               "setName", 0);
        digester.addCallMethod(fullPrefix + "/service-ref/service-interface",
                               "setInterface", 0);
        digester.addCallMethod(fullPrefix + "/service-ref/service-ref-type",
                               "setType", 0);
        digester.addCallMethod(fullPrefix + "/service-ref/wsdl-file",
                               "setWsdlfile", 0);
        digester.addCallMethod(fullPrefix + "/service-ref/jaxrpc-mapping-file",
                               "setJaxrpcmappingfile", 0);
        digester.addRule(fullPrefix + "/service-ref/service-qname", new ServiceQnameRule());

        digester.addRule(fullPrefix + "/service-ref/port-component-ref",
                               new CallMethodMultiRule("addPortcomponent", 2, 1));
        digester.addCallParam(fullPrefix + "/service-ref/port-component-ref/service-endpoint-interface", 0);
        digester.addRule(fullPrefix + "/service-ref/port-component-ref/port-component-link", new CallParamMultiRule(1));

        digester.addObjectCreate(fullPrefix + "/service-ref/handler",
                                 "org.apache.tomcat.util.descriptor.web.ContextHandler");
        digester.addRule(fullPrefix + "/service-ref/handler",
                         new SetNextRule("addHandler",
                         "org.apache.tomcat.util.descriptor.web.ContextHandler"));

        digester.addCallMethod(fullPrefix + "/service-ref/handler/handler-name",
                               "setName", 0);
        digester.addCallMethod(fullPrefix + "/service-ref/handler/handler-class",
                               "setHandlerclass", 0);

        digester.addCallMethod(fullPrefix + "/service-ref/handler/init-param",
                               "setProperty", 2);
        digester.addCallParam(fullPrefix + "/service-ref/handler/init-param/param-name",
                              0);
        digester.addCallParam(fullPrefix + "/service-ref/handler/init-param/param-value",
                              1);

        digester.addRule(fullPrefix + "/service-ref/handler/soap-header", new SoapHeaderRule());

        digester.addCallMethod(fullPrefix + "/service-ref/handler/soap-role",
                               "addSoapRole", 0);
        digester.addCallMethod(fullPrefix + "/service-ref/handler/port-name",
                               "addPortName", 0);
        digester.addRule(fullPrefix + "/service-ref/mapped-name",
                         new MappedNameRule());
        configureInjectionRules(digester, "web-app/service-ref/");
    }

    protected void configureInjectionRules(Digester digester, String base) {

        digester.addCallMethod(prefix + base + "injection-target", "addInjectionTarget", 2);
        digester.addCallParam(prefix + base + "injection-target/injection-target-class", 0);
        digester.addCallParam(prefix + base + "injection-target/injection-target-name", 1);

    }

    /**
     * Reset counter used for validating the web.xml file.
     */
    public void recycle(){
        jspConfig.isJspConfigSet = false;
        sessionConfig.isSessionConfigSet = false;
        loginConfig.isLoginConfigSet = false;
        name.isNameSet = false;
        absoluteOrdering.isAbsoluteOrderingSet = false;
        relativeOrdering.isRelativeOrderingSet = false;
    }
}

// ----------------------------------------------------------- Private Classes

/**
 * Rule to check that the login-config is occurring
 * only 1 time within the web.xml
 */
final class SetLoginConfig extends Rule {
    protected boolean isLoginConfigSet = false;
    public SetLoginConfig() {
        // NO-OP
    }

    @Override
    public void begin(String namespace, String name, Attributes attributes)
        throws Exception {
        if (isLoginConfigSet){
            throw new IllegalArgumentException(
            "<login-config> element is limited to 1 occurrence");
        }
        isLoginConfigSet = true;
    }

}

/**
 * Rule to check that the jsp-config is occurring
 * only 1 time within the web.xml
 */
final class SetJspConfig extends Rule {
    protected boolean isJspConfigSet = false;
    public SetJspConfig() {
        // NO-OP
    }

    @Override
    public void begin(String namespace, String name, Attributes attributes)
        throws Exception {
        if (isJspConfigSet){
            throw new IllegalArgumentException(
            "<jsp-config> element is limited to 1 occurrence");
        }
        isJspConfigSet = true;
    }

}

/**
 * Rule to check that the session-config is occurring
 * only 1 time within the web.xml
 */
final class SetSessionConfig extends Rule {
    protected boolean isSessionConfigSet = false;
    public SetSessionConfig() {
        // NO-OP
    }

    @Override
    public void begin(String namespace, String name, Attributes attributes)
        throws Exception {
        if (isSessionConfigSet){
            throw new IllegalArgumentException(
            "<session-config> element is limited to 1 occurrence");
        }
        isSessionConfigSet = true;
    }

}

/**
 * A Rule that calls the setAuthConstraint(true) method of
 * the top item on the stack, which must be of type
 * org.apache.tomcat.util.descriptor.web.SecurityConstraint.
 */

final class SetAuthConstraintRule extends Rule {

    public SetAuthConstraintRule() {
        // NO-OP
    }

    @Override
    public void begin(String namespace, String name, Attributes attributes)
        throws Exception {
        SecurityConstraint securityConstraint =
            (SecurityConstraint) digester.peek();
        securityConstraint.setAuthConstraint(true);
        if (digester.getLogger().isDebugEnabled()) {
            digester.getLogger()
               .debug("Calling SecurityConstraint.setAuthConstraint(true)");
        }
    }

}

/**
 * Class that calls setDistributable(true) for the top object
 * on the stack, which must be a {@link WebXml} instance.
 */
final class SetDistributableRule extends Rule {

    public SetDistributableRule() {
        // NO-OP
    }

    @Override
    public void begin(String namespace, String name, Attributes attributes)
        throws Exception {
        WebXml webXml = (WebXml) digester.peek();
        webXml.setDistributable(true);
        if (digester.getLogger().isDebugEnabled()) {
            digester.getLogger().debug
               (webXml.getClass().getName() + ".setDistributable(true)");
        }
    }
}

/**
 * Class that calls setDenyUncoveredHttpMethods(true) for the top
 * object on the stack, which must be a {@link WebXml} instance.
 */
final class SetDenyUncoveredHttpMethodsRule extends Rule {

    public SetDenyUncoveredHttpMethodsRule() {
        // NO-OP
    }

    @Override
    public void begin(String namespace, String name, Attributes attributes)
        throws Exception {
        WebXml webXml = (WebXml) digester.peek();
        webXml.setDenyUncoveredHttpMethods(true);
        if (digester.getLogger().isDebugEnabled()) {
            digester.getLogger().debug(webXml.getClass().getName() +
                    ".setDenyUncoveredHttpMethods(true)");
        }
    }
}

/**
 * Class that calls a property setter for the top object on the stack,
 * passing the public ID of the entity we are currently processing.
 */

final class SetPublicIdRule extends Rule {

    public SetPublicIdRule(String method) {
        this.method = method;
    }

    private String method = null;

    @Override
    public void begin(String namespace, String name, Attributes attributes)
        throws Exception {

        Object top = digester.peek();
        Class<?> paramClasses[] = new Class[1];
        paramClasses[0] = "String".getClass();
        String paramValues[] = new String[1];
        paramValues[0] = digester.getPublicId();

        Method m = null;
        try {
            m = top.getClass().getMethod(method, paramClasses);
        } catch (NoSuchMethodException e) {
            digester.getLogger().error("Can't find method " + method + " in "
                                       + top + " CLASS " + top.getClass());
            return;
        }

        m.invoke(top, (Object [])paramValues);
        if (digester.getLogger().isDebugEnabled())
            digester.getLogger().debug("" + top.getClass().getName() + "."
                                       + method + "(" + paramValues[0] + ")");

    }

}

/**
 * A Rule that calls the factory method on the specified Context to
 * create the object that is to be added to the stack.
 */

final class ServletDefCreateRule extends Rule {

    public ServletDefCreateRule() {
        // NO-OP
    }

    @Override
    public void begin(String namespace, String name, Attributes attributes)
        throws Exception {
        ServletDef servletDef = new ServletDef();
        digester.push(servletDef);
        if (digester.getLogger().isDebugEnabled())
            digester.getLogger().debug("new " + servletDef.getClass().getName());
    }

    @Override
    public void end(String namespace, String name)
        throws Exception {
        ServletDef servletDef = (ServletDef) digester.pop();
        if (digester.getLogger().isDebugEnabled())
            digester.getLogger().debug("pop " + servletDef.getClass().getName());
    }

}

/**
 * A Rule that can be used to call multiple times a method as many times as needed
 * (used for addServletMapping).
 */
final class CallParamMultiRule extends CallParamRule {

    public CallParamMultiRule(int paramIndex) {
        super(paramIndex);
    }

    @Override
    public void end(String namespace, String name) {
        if (bodyTextStack != null && !bodyTextStack.empty()) {
            // what we do now is push one parameter onto the top set of parameters
            Object parameters[] = (Object[]) digester.peekParams();
            @SuppressWarnings("unchecked")
            ArrayList<String> params = (ArrayList<String>) parameters[paramIndex];
            if (params == null) {
                params = new ArrayList<>();
                parameters[paramIndex] = params;
            }
            params.add(bodyTextStack.pop());
        }
    }

}

/**
 * A Rule that can be used to call multiple times a method as many times as needed
 * (used for addServletMapping).
 */
final class CallMethodMultiRule extends CallMethodRule {

    protected final int multiParamIndex;

    public CallMethodMultiRule(String methodName, int paramCount, int multiParamIndex) {
        super(methodName, paramCount);
        this.multiParamIndex = multiParamIndex;
    }

    /**
     * Process the end of this element.
     *
     * @param namespace the namespace URI of the matching element, or an
     *   empty string if the parser is not namespace aware or the element has
     *   no namespace
     * @param name the local name if the parser is namespace aware, or just
     *   the element name otherwise
     */
    @Override
    public void end(String namespace, String name) throws Exception {

        // Retrieve or construct the parameter values array
        Object parameters[] = null;
        if (paramCount > 0) {
            parameters = (Object[]) digester.popParams();
        } else {
            parameters = new Object[0];
            super.end(namespace, name);
        }

        ArrayList<?> multiParams = (ArrayList<?>) parameters[multiParamIndex];

        // Construct the parameter values array we will need
        // We only do the conversion if the param value is a String and
        // the specified paramType is not String.
        Object paramValues[] = new Object[paramTypes.length];
        for (int i = 0; i < paramTypes.length; i++) {
            if (i != multiParamIndex) {
                // convert nulls and convert stringy parameters
                // for non-stringy param types
                if(parameters[i] == null || (parameters[i] instanceof String
                        && !String.class.isAssignableFrom(paramTypes[i]))) {
                    paramValues[i] =
                        IntrospectionUtils.convert((String) parameters[i], paramTypes[i]);
                } else {
                    paramValues[i] = parameters[i];
                }
            }
        }

        // Determine the target object for the method call
        Object target;
        if (targetOffset >= 0) {
            target = digester.peek(targetOffset);
        } else {
            target = digester.peek(digester.getCount() + targetOffset);
        }

        if (target == null) {
            StringBuilder sb = new StringBuilder();
            sb.append("[CallMethodRule]{");
            sb.append("");
            sb.append("} Call target is null (");
            sb.append("targetOffset=");
            sb.append(targetOffset);
            sb.append(",stackdepth=");
            sb.append(digester.getCount());
            sb.append(")");
            throw new org.xml.sax.SAXException(sb.toString());
        }

        if (multiParams == null) {
            paramValues[multiParamIndex] = null;
            IntrospectionUtils.callMethodN(target, methodName, paramValues,
                    paramTypes);
            return;
        }

        for (int j = 0; j < multiParams.size(); j++) {
            Object param = multiParams.get(j);
            if(param == null || (param instanceof String
                    && !String.class.isAssignableFrom(paramTypes[multiParamIndex]))) {
                paramValues[multiParamIndex] =
                    IntrospectionUtils.convert((String) param, paramTypes[multiParamIndex]);
            } else {
                paramValues[multiParamIndex] = param;
            }
            IntrospectionUtils.callMethodN(target, methodName, paramValues,
                    paramTypes);
        }

    }

}

/**
 * A Rule that check if the annotations have to be loaded.
 *
 */

final class IgnoreAnnotationsRule extends Rule {

    public IgnoreAnnotationsRule() {
        // NO-OP
    }

    @Override
    public void begin(String namespace, String name, Attributes attributes)
        throws Exception {
        WebXml webxml = (WebXml) digester.peek(digester.getCount() - 1);
        String value = attributes.getValue("metadata-complete");
        if ("true".equals(value)) {
            webxml.setMetadataComplete(true);
        } else if ("false".equals(value)) {
            webxml.setMetadataComplete(false);
        }
        if (digester.getLogger().isDebugEnabled()) {
            digester.getLogger().debug
                (webxml.getClass().getName() + ".setMetadataComplete( " +
                        webxml.isMetadataComplete() + ")");
        }
    }

}

/**
 * A Rule that records the spec version of the web.xml being parsed
 *
 */

final class VersionRule extends Rule {

    public VersionRule() {
        // NO-OP
    }

    @Override
    public void begin(String namespace, String name, Attributes attributes)
        throws Exception {
        WebXml webxml = (WebXml) digester.peek(digester.getCount() - 1);
        webxml.setVersion(attributes.getValue("version"));

        if (digester.getLogger().isDebugEnabled()) {
            digester.getLogger().debug
                (webxml.getClass().getName() + ".setVersion( " +
                        webxml.getVersion() + ")");
        }
    }

}

/**
 * A rule that ensures only a single name element is present.
 */
final class NameRule extends Rule {

    protected boolean isNameSet = false;

    public NameRule() {
        // NO-OP
    }

    @Override
    public void begin(String namespace, String name, Attributes attributes)
        throws Exception {
        if (isNameSet){
            throw new IllegalArgumentException(WebRuleSet.sm.getString(
                    "webRuleSet.nameCount"));
        }
        isNameSet = true;
    }

    @Override
    public void body(String namespace, String name, String text)
            throws Exception {
        super.body(namespace, name, text);
        ((WebXml) digester.peek()).setName(text);
    }
}

/**
 * A rule that logs a warning if absolute ordering is configured for a fragment
 * and fails if multiple absolute orders are configured.
 */
final class AbsoluteOrderingRule extends Rule {

    protected boolean isAbsoluteOrderingSet = false;
    private final boolean fragment;

    public AbsoluteOrderingRule(boolean fragment) {
        this.fragment = fragment;
    }

    @Override
    public void begin(String namespace, String name, Attributes attributes)
            throws Exception {
        if (fragment) {
            digester.getLogger().warn(
                    WebRuleSet.sm.getString("webRuleSet.absoluteOrdering"));
        }
        if (isAbsoluteOrderingSet) {
            throw new IllegalArgumentException(WebRuleSet.sm.getString(
                    "webRuleSet.absoluteOrderingCount"));
        } else {
            isAbsoluteOrderingSet = true;
            WebXml webXml = (WebXml) digester.peek();
            webXml.createAbsoluteOrdering();
            if (digester.getLogger().isDebugEnabled()) {
                digester.getLogger().debug(
                        webXml.getClass().getName() + ".setAbsoluteOrdering()");
            }
        }
    }
}

/**
 * A rule that logs a warning if relative ordering is configured.
 */
final class RelativeOrderingRule extends Rule {

    protected boolean isRelativeOrderingSet = false;
    private final boolean fragment;

    public RelativeOrderingRule(boolean fragment) {
        this.fragment = fragment;
    }

    @Override
    public void begin(String namespace, String name, Attributes attributes)
            throws Exception {
        if (!fragment) {
            digester.getLogger().warn(
                    WebRuleSet.sm.getString("webRuleSet.relativeOrdering"));
        }
        if (isRelativeOrderingSet) {
            throw new IllegalArgumentException(WebRuleSet.sm.getString(
                    "webRuleSet.relativeOrderingCount"));
        } else {
            isRelativeOrderingSet = true;
        }
    }
}

/**
 * A Rule that sets soap headers on the ContextHandler.
 *
 */
final class SoapHeaderRule extends Rule {

    public SoapHeaderRule() {
        // NO-OP
    }

    /**
     * Process the body text of this element.
     *
     * @param namespace the namespace URI of the matching element, or an
     *   empty string if the parser is not namespace aware or the element has
     *   no namespace
     * @param name the local name if the parser is namespace aware, or just
     *   the element name otherwise
     * @param text The body text of this element
     */
    @Override
    public void body(String namespace, String name, String text)
            throws Exception {
        String namespaceuri = null;
        String localpart = text;
        int colon = text.indexOf(':');
        if (colon >= 0) {
            String prefix = text.substring(0,colon);
            namespaceuri = digester.findNamespaceURI(prefix);
            localpart = text.substring(colon+1);
        }
        ContextHandler contextHandler = (ContextHandler)digester.peek();
        contextHandler.addSoapHeaders(localpart,namespaceuri);
    }
}

/**
 * A Rule that sets service qname on the ContextService.
 *
 */
final class ServiceQnameRule extends Rule {

    public ServiceQnameRule() {
        // NO-OP
    }

    /**
     * Process the body text of this element.
     *
     * @param namespace the namespace URI of the matching element, or an
     *   empty string if the parser is not namespace aware or the element has
     *   no namespace
     * @param name the local name if the parser is namespace aware, or just
     *   the element name otherwise
     * @param text The body text of this element
     */
    @Override
    public void body(String namespace, String name, String text)
            throws Exception {
        String namespaceuri = null;
        String localpart = text;
        int colon = text.indexOf(':');
        if (colon >= 0) {
            String prefix = text.substring(0,colon);
            namespaceuri = digester.findNamespaceURI(prefix);
            localpart = text.substring(colon+1);
        }
        ContextService contextService = (ContextService)digester.peek();
        contextService.setServiceqnameLocalpart(localpart);
        contextService.setServiceqnameNamespaceURI(namespaceuri);
    }

}

/**
 * A rule that checks if the taglib element is in the right place.
 */
final class TaglibLocationRule extends Rule {

    final boolean isServlet24OrLater;

    public TaglibLocationRule(boolean isServlet24OrLater) {
        this.isServlet24OrLater = isServlet24OrLater;
    }

    @Override
    public void begin(String namespace, String name, Attributes attributes)
            throws Exception {
        WebXml webXml = (WebXml) digester.peek(digester.getCount() - 1);
        // If we have a public ID, this is not a 2.4 or later webapp
        boolean havePublicId = (webXml.getPublicId() != null);
        // havePublicId and isServlet24OrLater should be mutually exclusive
        if (havePublicId == isServlet24OrLater) {
            throw new IllegalArgumentException(
                    "taglib definition not consistent with specification version");
        }
    }
}

/**
 * A Rule that sets mapped name on the ResourceBase.
 */
final class MappedNameRule extends Rule {

    public MappedNameRule() {
        // NO-OP
    }

    /**
     * Process the body text of this element.
     *
     * @param namespace the namespace URI of the matching element, or an
     *   empty string if the parser is not namespace aware or the element has
     *   no namespace
     * @param name the local name if the parser is namespace aware, or just
     *   the element name otherwise
     * @param text The body text of this element
     */
    @Override
    public void body(String namespace, String name, String text)
            throws Exception {
        ResourceBase resourceBase = (ResourceBase) digester.peek();
        resourceBase.setProperty("mappedName", text.trim());
    }
}

/**
 * A rule that fails if more than one post construct or pre destroy methods
 * are configured per class.
 */
final class LifecycleCallbackRule extends CallMethodRule {

    private final boolean postConstruct;

    public LifecycleCallbackRule(String methodName, int paramCount,
            boolean postConstruct) {
        super(methodName, paramCount);
        this.postConstruct = postConstruct;
    }

    @Override
    public void end(String namespace, String name) throws Exception {
        Object[] params = (Object[]) digester.peekParams();
        if (params != null && params.length == 2) {
            WebXml webXml = (WebXml) digester.peek();
            if (postConstruct) {
                if (webXml.getPostConstructMethods().containsKey(params[0])) {
                    throw new IllegalArgumentException(WebRuleSet.sm.getString(
                            "webRuleSet.postconstruct.duplicate", params[0]));
                }
            } else {
                if (webXml.getPreDestroyMethods().containsKey(params[0])) {
                    throw new IllegalArgumentException(WebRuleSet.sm.getString(
                            "webRuleSet.predestroy.duplicate", params[0]));
                }
            }
        }
        super.end(namespace, name);
    }
}

final class SetOverrideRule extends Rule {

    public SetOverrideRule() {
        // no-op
    }

    @Override
    public void begin(String namespace, String name, Attributes attributes) throws Exception {
        ContextEnvironment envEntry = (ContextEnvironment) digester.peek();
        envEntry.setOverride(false);
        if (digester.getLogger().isDebugEnabled()) {
            digester.getLogger().debug(envEntry.getClass().getName() + ".setOverride(false)");
        }
    }
}

redpajama_set_name: RedPajamaGithub


We'll be attending the Sunday show and was looking for reports of Saturday's as far as security getting. From what I've heard, there will be metal detectors at the gates but how thorough are the operators?
It's not so much needing it in the Stadium, but more concerned about walking to and fro.
If you happen to attend Saturdays show, feel free to report back. Thanks.
If it's similar to the shows at Allstate Arena in Rosemont IL, they wand you and send you away for damn near anything.
I had to return my Leatherman, and my AAA Streamlight to the car.
The small pocketknife on my key ring was ignored.
Live Nation event? If so, ALL Live Nation venues have wands, or walk throughs. If not, Lucas is spotty at best on security. Do they have the equipment, YES, do they know how to use it, SOMETIMES. If it's important to you, junk carry a smaller gun and see. I guarantee, nobody there will touch you junk, no matter how many sounds it makes.
Just went through. I could have been carrying OWB and got through. The check points are a joke.
Wish I wouldve known that, my daughter took her 2 little boys to it last night. Figured with the security and metal detectors it wouldve been slightly thorough...I shouldve known and shouldve went with but work keeps me from a lot.
If it matters for future reference, CSC Event Staff are the one running security.
I didn't take my son because they've gone political and took away any reference to guns on their trucks. I contacted them and they confirmed this. Instead, I took him to the World of Wheels at the fairgrounds.
For almost every non NFL event I have been to there, it has been this way. The metal detectors have not typically been in use during non NFL events, I have attended. Bags get looked into, but nothing else, in my experience, so this doesn't surprise me.
The metal detectors were on. I held up my phone and walked through. It went off and the guy said you're ok. They had my wife open her handbag to look in. She unzipped it and they just barely glanced in. They didn't even check my 10 y o daughters huge purse.
So how was the show...???
Really sorry we could not meet you folks for dinner. Life.


Fast trains from Arezzo to Perugia take around 52 minutes, covering a distance of approximately 57 kilometres. There are frequent services on the rail route between Arezzo and Perugia.
1. Are there direct trains from Arezzo to Perugia?
Direct trains from Arezzo to Perugia have been found.
We usually find around 8 direct trains on the route from Arezzo to Perugia every weekday.
2. How long is the train journey from Arezzo to Perugia?
The Arezzo to Perugia train travel time is normally about 52 minutes, whatever time you make the journey.
3. What are the Arezzo to Perugia train times and schedule?
On weekdays the earliest direct train to Perugia is usually scheduled to depart Arezzo around 09:13 and the last train is around 22:25. At weekends the first train of the day leaves Arezzo around 09:13, and the last at 22:24.
What's the Arezzo to Perugia train price?
The cheapest tickets we've found for trains from Arezzo to Perugia are $8.52, and there isn't much difference in price depending on when you book.
When to book Arezzo to Perugia train tickets?
Trains in Italy usually open for booking around 6 months in advance. If booking is not yet open for your dates then you can set a booking alert to receive an email on the day that the cheapest tickets are released for your journey from Arezzo to Perugia by train.
Which train companies operate between Arezzo and Perugia?


Nayef H. Samhat addressed the Class of 2022 at the Opening Convocation on Aug. 26.
Thank you, President Roush, and everyone at Centre. I cannot describe to you how honored Prema and I are to be here with you this evening, how much this means to us personally, for Centre College is dear to us. It is great to be back.
Like all of you in the class of 2022, I began a journey right here at Centre College, in this hall, in 1996. After several years in a small family business and as the father of two young daughters, I returned to graduate school to study for my Ph.D. Our third daughter, a 2016 Centre graduate, came along during that time.
We moved to Danville in 1996 when it was a much quieter town, and for me — someone who was accustomed to big cities in the Midwest — I admit that I never imagined living in Kentucky. Of course, I never imagined living in South Carolina either! But how fortunate we were.
The point, of course, is that our lives are filled with twists and turns, and people, who shape our paths, point us to opportunity, and it is up to you to take some charge of your life and the opportunities it presents.
So it is with Centre. When Prema and I moved here with our three daughters, Alia, Jehani and Leila, we did so with excitement and anticipation. I was joining a Government program with colleagues who are lifelong and dear friends — Dan Stroup, Bill Garriott, the late Larry Matheny. Lori Hartmann joined the program and too became a dear and lifelong friend. We met so many others throughout the college and the Danville community who became lifelong and dear friends.
There were other treasured friends and mentors — Mike Adams, who was president when I came, and John Ward who was Dean of the College. President Roush came to Centre and afterwards Stephanie Fabritius arrived as Dean once John Ward retired. To you students these are perhaps unfamiliar names — or most of them are — but to me and my family, these colleagues, friends and mentors — everyone and more — touched us in profound ways. This is the unexpected nature of our path and the beauty and the wonder of this college. Because of the inspiration and encouragement provided by these friends and mentors, their unfailing support, their guidance and advice, I began to think about opportunities in my career that were exciting and novel. These people and this college transformed our life. And this college will transform your life, too.
Now I don't know if you'll become a college president, but you'll probably do something different than you may have imagined when you arrived.
And when you do, you need to take along with you something about Centre that is distinctive. For when I arrived I entered a community of educators, of friends and colleagues, that was defined by something special, that other places struggled to achieve. It was a shared respect and civility amongst the faculty and administrative colleagues. The academy has a reputation as a political environment, but Centre was different. Faculty meetings were not great battles over small stakes, as the saying goes. There were no battles really. Centre was different. And the students followed this endearing and, I suspect, enduring culture of Centre College. It was a wonderful community that knew how to discuss difficult issues, that at the end of the day adhered to principles of comity and respect, where civility amongst and between peers whether faculty, staff and coaches, and students defined what being a part of Centre College was all about.
So why is civility important? Why is thinking about civility in relation to our journey important as we begin the academic year? I believe that civility and the capacity to build community are the most important things you will take with you on your life's journey.
You know this, but I will state it: We live in turbulent times; some say dangerous times. Attending college is a gift, a privilege. And while I wish describing these times as turbulent were fake news, it's not. The Southern Poverty Law Center has reported back-to-back record-breaking years for hate crimes and extremist activity, even on college campuses. International students are afraid to go home because they may not be able to return to college. We are arguing over statues, voting rights, guns and guns in schools, education, immigration and border walls — you name it. We are even debating truth: alternative facts, or is it truth isn't truth?
Standing against the forces that threaten our educational opportunities, our freedoms and human rights is a risk, and the fallout can get messy. Here is personal experience: In early 2017, we joined other colleges and universities across the county supporting the Association of American Colleges and Universities' request that the Trump "administration's new order barring the entry or return of individuals from certain countries end as quickly as possible." We, as an academic community, urged the United States government to welcome the most talented individuals from all countries to study, teach and carry out research and scholarship at our colleges and universities. This order, of course, reflected a sustained criticism of some immigrants from some countries, which continues to this day.
The college's letter of support for the AACU — signed by me on behalf of the Wofford College community — led to correspondence from friends of the college and even a group of students who started a petition criticizing our stance. Some of those letters were frankly disrespectful and uncivil, so much so that they did their argument much more harm than good. But even though some of the negative responses were less than gracious in their tone, what stood out was a sense of fear — perhaps a fear of difference or a fear of change. Fear seemed to permeate many responses; and while it must be terribly hard to live in such fear, we cannot and will not be bullied by the people who turn that fear into prejudice and hate, immigration bans and border walls.
The good news is that over a couple of weeks far more of the letters and emails the college received were positive, praising Wofford for making such a bold statement, and another group of students started a counter-petition supporting the college administration and the statement asking the Trump administration to resend its draconian order. Over the course of those correspondence-filled days, the counter-petition far surpassed the other in signatures, and the conversation on campus that took place was shaped by a culture of inclusiveness, respect and civility.
Liberal arts colleges like ours have shared good times and challenging times with their surrounding cities, states and nation. In May, your own campus community made some headlines and found ways to consider important questions of diversity, equity and inclusion. In doing so through protest, you demonstrated what it means to live and learn on the campus of a liberal arts college, where we seek to mirror society and to promote the change we desire in our campus community and in our world. And here is an important lesson: To make a call for civility is not to replace or displace action. Action and civility are not mutually exclusive, and we mustn't rely on calls for civility to substitute for those times and those issues when real action is required, knowing full well that action takes a variety of forms: engagement in normal channels of governance and decision making, but also in marches, panel discussions, candlelight vigils, and articles in the campus newspaper; these are all ways for you to take a stance on issues and decide what you believe, to bring a vision for your community in concert with others in alignment with the world around you.
Naturally there will be tension when difficult questions are posed, questions that confront us all with inflection points of social, cultural or community change. But that is not a reason to avoid that dialogue or to avoid engagement just as it is not a reason to depart from principled norms of civility. Rather, it is when those most difficult questions are addressed that a reliance on relations of civility is most necessary because our resolutions do not erase our memories. The journey is every bit as important as the outcome, one that we hope has advanced our community, and reconciliation is made all the stronger and more enduring if founded principles of mutual civility.
Hence, college campuses are not impenetrable bubbles, but they do remain spaces where academic freedom still protects free speech and critical thinking and experimentation, places where individual students are valued for exploring, dreaming and discussing the big questions. I would go as far as to say that on liberal arts campuses like ours you are encouraged to challenge the status quo, question received wisdom and imagine solutions to the many problems facing our world. The ethos of civility that our liberal arts campuses offer allow for this type of open dialogue and engagement, and so make no mistake about it, you are privileged to be a student where this can happen. Do it with respect, with civility, and carry this ethos of civil engagement with you when you leave here because, as our contemporary circumstances suggest, it is in short supply out there and the fabric of our democracy depends on it.
Now it is a pretty sweeping claim to assert that our democracy depends on it. And I realize that is a pretty heavy burden I'm putting on you. Yet I believe higher education and the experience you are about to embark upon is about more than getting a job. I really and truly believe it is about cultivating a broad notion of citizenship and civility that strengthens all of us.
Take, for example, a 2017 Washington Post op-ed by Bill Bishop, co-author of "The Big Sort: Why the Clustering of Like-Minded America is Tearing Us Apart." Bishop writes that everything about modern life works against community and trust, generating a polarized society. He references Gallup polls of U.S. adults over the past 40 years to demonstrate the erosion of confidence that Americans now have in major institutions, including the public-school system (down 28% since the 1970s), banks (down 33%), religious organizations (down 24%) and media (down 31%). There is a lack of faith in our electoral system and, troubling for the likes of us, an erosion of trust and confidence in higher education. If this is what the clustering of like-minded America is doing, then I completely agree with Mr. Bishop; it is tearing us apart.
It should come as no surprise then that the 8th Civility in America study found that 93 percent of the public agrees that the nation has a major civility problem. According to the survey, nearly three quarters of the public — from both major political parties — agree that the problem has gotten worse in recent years. Most importantly, the public is almost unanimous in citing the importance of civility to democracy.
Why is this important as you begin your college career?
It is important because as a community of learners, of citizens, it is not only necessary to embrace the diversity of the world around us — whether we speak of faith, ethnicity, race, sexual orientation, geography, socio-economic status — society is an ever more complex quilt, and you do a disservice to yourself if you do not pursue the opportunity to learn from the diverse experiences of others. But it is also important how you embrace this world. You must model civility while fostering connections between what is learned in the classroom and the application of knowledge in complex and challenging circumstances, and you must develop in yourself a deep consciousness of our globality — our place in a complex network of economic, political, social and cultural cross-currents, where, for example, service and learning in Danville, KY, or somewhere in South Asia, is recognized as not only an enhancement to our community, but as part of a larger logic of humanity, shared with others at multiple points, places, and experiences around the globe.
Here I am struck by an argument offered by Evgeny Morozov, in a New York Times op-ed essay, "The Perils of Perfection." It is an argument about the solutions we seek and our increasing faith in technology. As he argues, "Sunny, smooth, clean: with Silicon Valley at the helm, our life will become one long California highway." We will have available a world of apps to outsource our decisions; apps to spot inconsistencies in our behavior and notify us — to correct us; we snap images and take videos, so we never have to worry about forgetting; we are on the verge of creating a consistency in our lives and our experiences — a kind of perfection of lived lives, a "digital humanitarianism" where techno-solutions bring an ease to our existence erasing the need for the reflective balancing of alternatives, the engagement with others, and the search for ethical principles on which to ground outcomes.
More to the point, of course, is that the problems we face are not all solvable by social media, techno-surveys of friends and families, networks of advice givers. In fact, many if not most of our challenges require concerted effort, concentration, hard work, cooperation with others, human ingenuity unmediated by technologies.
No, the challenges are greater and more complex, and the opportunities before you as profound as any moment in history. I want you to think about this for a moment. I want you to come to understand the world in which you live: It is one defined by diversity and the blending of peoples of varying races, faiths, ethnicities and sexual orientations. It is defined by the intensity and density of cultural, economic, and social networks spanning the globe. The pace of interactions, knowledge and flows are unknown in human history, and therefore creating the conditions of change that challenge the presumptions and settled circumstances of eras gone by. Whether in Lexington, Paris, Beijing or Spartanburg, the world you live today is vastly different from the world of mere decades ago, and it will be even more so mere decades from now.
And while we will continue to rely on our technologies for conveniences, we must step away from the illusion that those very technologies are solutions. You need to avoid being lulled into to a false sense of understanding your world through flat screens, text messages, twitter, and Facebook and apps.
First, you must pursue excellence in all that you do — in the classroom and out, on the stages and studios of performance and the fields and courts of play — you must never settle for less. You will not always succeed or be the best, but you will have no regrets.
Second, you must engage your world — challenge your senses, your emotions, your physical and intellectual limits. You must "do" and experience, find ways to help others, to become aware, and do so with the respect that reinforces and advances your community.
The rebuilding of trust, the renewal of our institutions in our communities and our society, is not a virtual exercise; it is a human exercise. It requires dialogue and engagement. And by your own self-transformation over the next four years, you will have the capacity to re-imagine and contribute to our collective transformation. That is your responsibility.
In so doing, you will come to realize the promise of our humanity, founded on that extraordinary and infinite source of human ingenuity, compassion, aspiration and civility that resides in us all, and binds us to each other wherever we may be.
Now take your new-found freedom and change our world!


This is a placeholder page for Curt Bornheim, which means this person is not currently on this site. We do suggest using the tools below to find Curt Bornheim.
You are visiting the placeholder page for Curt Bornheim. This page is here because someone used our placeholder utility to look for Curt Bornheim. We created this page automatically in hopes Curt Bornheim would find it. If you are not Curt Bornheim, but are an alumni of Hull High School, register on this site for free now.


text:
Q: MongoDB Aggregate for a sum on a per week basis for all prior weeks I've got a series of docs in MongoDB. An example doc would be
{
  createdAt: Mon Oct 12 2015 09:45:20 GMT-0700 (PDT),
  year: 2015,
  week: 41
}

Imagine these span all weeks of the year and there can be many in the same week. I want to aggregate them in such a way that the resulting values are a sum of each week and all its prior weeks counting the total docs.
So if there were something like 10 in the first week of the year and 20 in the second, the result could be something like
[{ week: 1, total: 10, weekTotal: 10},
 { week: 2, total: 30, weekTotal: 20}]

Creating an aggregation to find the weekTotal is easy enough. Including a projection to show the first part
db.collection.aggregate([
  {
    $project: {
      "createdAt": 1,
      year: {$year: "$createdAt"},
      week: {$week: "$createdAt"},
      _id: 0
    }
  },
  {
    $group: {
      _id: {year: "$year", week: "$week"},
      weekTotal : { $sum : 1 }
    }
  },
]);

But getting past this to sum based on that week and those weeks preceding is proving tricky.

A: The aggregation framework is not able to do this as all operations can only effectively look at one document or grouping boundary at a time. In order to do this on the "server" you need something with access to a global variable to keep the "running total", and that means mapReduce instead:
db.collection.mapReduce(
    function() {

        Date.prototype.getWeekNumber = function(){
            var d = new Date(+this);
            d.setHours(0,0,0);
            d.setDate(d.getDate()+4-(d.getDay()||7));
            return Math.ceil((((d-new Date(d.getFullYear(),0,1))/8.64e7)+1)/7);
        };

        emit({ year: this.createdAt.getFullYear(), week: this.createdAt.getWeekNumber() }, 1);
    },
    function(values) {
        return Array.sum(values);
    },
    {
        out: { inline: 1 },
        scope: { total: 0 },
        finalize: function(value) {
            total += value;
            return { total: total, weekTotal: value }
        }
    }
)

If you can live with the operation occuring on the "client" then you need to loop through the aggregation result and similarly sum up the totals:
var total = 0;

db.collection.aggregate([
    { "$group": {
        "_id": {
            "year": { "$year": "$createdAt" },
            "week": { "$week": "$createdAt" }
        },
        "weekTotal": { "$sum": 1 }
    }},
    { "$sort": { "_id": 1 } }
]).map(function(doc) {
    total += doc.weekTotal;
    doc.total = total;
    return doc;
});

It's all a matter of whether it makes the most sense to you of whether this needs to happen on the server or on the client. But since the aggregation pipline has no such "globals", then you probably should not be looking at this for any further processing without outputting to another collection anyway.

redpajama_set_name: RedPajamaStackExchange


text:
Alarming Increase in Cybercriminals Utilizing ChatGPT Reported
In November 2022, OpenAI released ChatGPT, a new interface for its Large Language Model (LLM), which generated significant interest in the potential uses of AI. However, ChatGPT also added complexity to the modern cyber threat landscape as it became apparent that code generation could assist less-skilled threat actors in launching cyberattacks.
Check Point Research (CPR) previously described how ChatGPT could successfully conduct a full infection flow, from creating a convincing spear-phishing email to running a reverse shell, capable of accepting commands in English. The question remains whether this is a hypothetical threat or if threat actors are already using OpenAI technologies for malicious purposes.
READ MORE: OpenAI Reportedly Developing Tool to Detect ChatGPT-Generated Text
CPR's analysis of several major underground hacking communities revealed that there are already instances of cybercriminals using OpenAI to develop malicious tools. As suspected, some cases clearly showed that many cybercriminals using OpenAI have no development skills. Although the tools presented in the report are basic, it is only a matter of time before more sophisticated threat actors enhance their use of AI-based tools for malicious purposes.
On December 29, 2022, a thread titled "ChatGPT – Benefits of Malware" appeared on a widely-used underground hacking forum. The person who posted the thread revealed that they were experimenting with ChatGPT to recreate malware strains and techniques discussed in research publications and write-ups about typical malware. To demonstrate this, they shared the code for a Python-based stealer that searches for common file types, copies them to a randomly chosen folder within the Temp folder, compresses them into a ZIP file, and uploads them to a pre-determined FTP server.
CRP's examination of the script confirms the claims made by the cybercriminal. The script is indeed a basic stealer that searches for 12 common file types (such as MS Office documents, PDFs, and images) across the system. If any relevant files are found, the malware copies them to a temporary directory, compresses them into a ZIP file, and sends them over the internet. It is worth noting that the actor did not bother to encrypt or securely send the files, so they may be obtained by third parties.
The second sample created by this actor using ChatGPT is a simple Java snippet. It downloads PuTTY, a widely-used SSH and telnet client, and covertly runs it on the system using Powershell. This script can be modified to download and run any program, including common malware families.
This threat actor has previously shared several scripts for automating the post-exploitation phase, and a C++ program that attempts to phish for user credentials. Additionally, they actively share cracked versions of SpyNote, an Android RAT malware. Overall, this individual seems to be a tech-savvy threat actor, and the purpose of their posts is to show less technically capable cybercriminals how to utilize ChatGPT for malicious purposes, with real examples they can immediately use.
It remains uncertain whether ChatGPT capabilities will become a popular tool among individuals on the Dark Web. However, the cybercriminal community has already shown significant interest and has begun experimenting with this latest trend of generating malicious code. CPR plans to continue monitoring this activity throughout the year 2023.
Previous articleNairobi County Launches New Payments Platform, Again
Next articleSpotify Now Allows You to Reminisce About Songs That Defined A Specific Moment in Time
ChatGPT to be Available on Azure OpenAI Service for Businesses to Utilize Advanced AI Models
ChatGPT Professional Imminent as Microsoft Plans to Pump Billions into OpenAI
OpenAI Reportedly Developing Tool to Detect ChatGPT-Generated Text
Cyberattacks in Countries Such As the US Are Targeting Healthcare for Medical Records
Code for Africa, Google Jigsaw's Anti-troll AI Tool is Coming to Twitter to Protect African Women

redpajama_set_name: RedPajamaCommonCrawl


Coffee – bar: | Port d'Àger :: Hotel** – restaurant. Ajotjament, hotel rural, familiar a la vall d'Àger.
Space located on the ground floor of the building where you will find the hotel reception.
Pleasant area where we highlight a former renaissance altar transformed into service bar and a fireplace that takes center stage in winter.
Meeting place for athletes who come to refreshduring the activity, or looking for information about the area, or to find the warmth of the fireplaceafter the activity.
At the same time enjoy some of our exhibitions are decorated with the space.
Artist born in Haarlem, the Netherlands and cultivated in the school of arts in Rotterdam. In this small of our work, to celebrate the tenth anniversary of his study and workshop located in the valley Ager.


text:
Core - corrosive environments
Supra - highly corrosive environments
Forta - duplex and other high strength
Ultra - extremely corrosive environments
Dura - high hardness
Therma - high service temperatures
Prodec - superior machinability
Language: Polski lvl_1 trigger (lang)
Bottomless Finnish beauty
Case Finlandia vase
Mari Suonto 2017
PlatinOro's classic Finlandia designer vase was remade as a stainless steel version to celebrate Finland's centenary.
Outokumpu austenitic stainless steel Core from Tornio paired with local craftsmanship ensured that the vases are 100% Finnish designer pieces.
Steel grade: Outokumpu Core 304/4301
Surface finish: bright annealed BA/2R
It was a beautiful summer day sometime in the late 1990s. Silversmith Pekka Piekäinen was laying on the front lawn of his summer house, when suddenly the thought struck like a lightning. "A vase with no bottom!" And so the idea for the Finlandia vase was born.
The vase indeed has a unique design: the bottom is an almost razor-thin S-shape, with the sides expanding out to create a clean, wave-like shape. Like many of Piekäinen's designs, the shape was inspired by nature and has a distinctly modern, minimalist quality.
In 2017, in celebration of Finland's 100th year of independence, a special new edition of Piekäinen's original silvery vase is being made – this time out of Outokumpu stainless steel. The grade used is Core 304/4301 with bright annealed surface finish BA/2R.
100% Finnish for Finland 100
In fact, the stainless steel Finlandia vase has been a long-time in the making, says Anna-Kaisa Laakso, who co-founded jewelry and design brand PlatinOro with the late Piekäinen back in the 1990s. "We originally wanted to create a stainless steel version of the vase, but at the time, we could not find anyone who would be able to produce it: the shape of Finlandia is quite demanding to forge out of such a hard material," she explains.
Recently, however, Laakso discovered Finnish steel smithy Nikama Design, which specializes in stainless steel design objects and was up to the task. "It turned out to be a perfect fit," says Laakso. "We were able to create a 100% Finnish designer product: it's made from locally-produced stainless steel from Outokumpu's mill in Tornio, and hand-crafted by a Finnish steel smith." The vase was chosen to be part of an official selection of all-Finnish products celebrating the centenary called "100 goods from Finland".
Durable design for the ages
Though crafting the Finlandia design from stainless steel was not an easy feat, there are also clear benefits to using stainless as the material, says Laakso. "On top of being a local material, it also allowed us to create a more affordable – and highly durable – counterpart to the silver vase," she says. "It's a timeless piece of art suitable for a broader audience: beautiful and modern, but still practical and easy to keep clean."
The solid environmental credentials of Outokumpu stainless are also a fit with Piekäinen's design philosophy. "Piekäinen was a lover of nature, and often found his inspiration from Finnish nature, so environmental values are very important for us. I believe he would be very happy to see his design being crafted out of Finnish stainless steel," Laakso says.
Recommended products and insight
When it comes to appliances, today's consumer insists on full functionality wrapped in effortless beauty. Corrosion-resistant, easy to clean, strong and formable: Stainless steel delivers durable, timeless perfection.
The Core range contains austenitic and ferritic stainless steel products for mild to medium corrosive environments. The classic 18/8 stainless steel is part of Outokumpu Core range.
Tornio, Finland
Outokumpu's Tornio operations is the most integrated stainless steel plant in the world. State-of-the-art technology, sophisticated equipment and unrivaled expertise produce outstanding quality year after year.
Outokumpu's four value propositions: recycling maximized, nothing to hide, pays for itself and indispensability showcase Outokumpu's strengths, which answer to key sustainability needs. By selecting Outokumpu's stainless steel, our customers also benefit from these in their own sustainability efforts.
Case Imminkhuizen Metaaltechniek
Faster, more automated production is the future
Case ABS Safety GmbH
Consistency is key to ABS Safety's production security
Case wastewater treatment tanks
Outokumpu Forta enabled innovative wastewater treatment tanks
Case new generation tank building
Straight on the spot
Case Parcitank wine tanks
"Salud" to the Supra 316plus
Case BC INOXEO swimming pools
Outokumpu Supra 316plus is doing swimmingly in France
Case 7-Eleven illuminated signs
Outokumpu Core 4622 shines from 7-Eleven
Case Suter Inox tailored kitchen
Perfect stainless steel design for the classiest dream kitchens
Case outdoor hot tubs
Stainless spas upgrade to Supra 316plus