Examples of AlternateDocBase


Examples of com.sun.grizzly.util.http.mapper.AlternateDocBase

            throw new IllegalArgumentException(
                sm.getString(
                    "standardContext.alternateDocBase.missingPathOrUrlPattern"));
        }

        AlternateDocBase alternateDocBase = new AlternateDocBase();
        alternateDocBase.setUrlPattern(urlPattern);
        alternateDocBase.setDocBase(docBase);
        alternateDocBase.setBasePath(getBasePath(docBase));

        if (alternateDocBases == null) {
            alternateDocBases = new ArrayList<AlternateDocBase>();
        }
        alternateDocBases.add(alternateDocBase);
View Full Code Here

Examples of com.sun.grizzly.util.http.mapper.AlternateDocBase

        File file = null;
        if (alternateDocBases == null
                || alternateDocBases.size() == 0) {
            file = new File(getBasePath(getDocBase()), path);
        } else {
            AlternateDocBase match = AlternateDocBase.findMatch(
                                                path, alternateDocBases);
            if (match != null) {
                file = new File(match.getBasePath(), path);
            } else {
                // None of the url patterns for alternate doc bases matched
                file = new File(getBasePath(getDocBase()), path);
            }
        }
View Full Code Here

Examples of com.sun.grizzly.util.http.mapper.AlternateDocBase

        if (alternateDocBases == null
                || alternateDocBases.size() == 0) {
            resources = getResources();
        } else {
            AlternateDocBase match = AlternateDocBase.findMatch(
                                path, alternateDocBases);
            if (match != null) {
                resources = match.getResources();
            } else {
                // None of the url patterns for alternate doc bases matched
                resources = getResources();
            }
        }
View Full Code Here

Examples of com.sun.grizzly.util.http.mapper.AlternateDocBase

            DirContext resources = null;
            if (alternateDocBases == null
                    || alternateDocBases.size() == 0) {
                resources = context.getResources();
            } else {
                AlternateDocBase match = AlternateDocBase.findMatch(
                                                path, alternateDocBases);
                if (match != null) {
                    resources = match.getResources();
                } else {
                    // None of the url patterns for alternate doc bases matched
                    resources = getResources();
                }
            }
View Full Code Here

Examples of com.sun.grizzly.util.http.mapper.AlternateDocBase

        if (alternateDocBases == null
                || alternateDocBases.size() == 0) {
            resources = getResources();
        } else {
            AlternateDocBase match = AlternateDocBase.findMatch(
                                path, alternateDocBases);
            if (match != null) {
                resources = match.getResources();
            } else {
                // None of the url patterns for alternate doc bases matched
                resources = getResources();
            }
        }
View Full Code Here

Examples of com.sun.grizzly.util.http.mapper.AlternateDocBase

        ProxyDirContext proxyDirContext = resources;
        if (alternateDocBases == null
                || alternateDocBases.size() == 0) {
            cacheEntry = proxyDirContext.lookupCache(path);
        } else {
            AlternateDocBase match = AlternateDocBase.findMatch(
                                            path, alternateDocBases);
            if (match != null) {
                cacheEntry = ((ProxyDirContext) match.getResources()).lookupCache(path);
            } else {
                // None of the url patterns for alternate docbases matched
                cacheEntry = proxyDirContext.lookupCache(path);
            }
        }
View Full Code Here

Examples of org.apache.catalina.core.AlternateDocBase

                log("DefaultServlet.serveResource:  Serving resource '" +
                    path + "' headers only");
        }

        CacheEntry cacheEntry = null;
        AlternateDocBase match = null;
        if (alternateDocBases == null
                || alternateDocBases.size() == 0) {
            cacheEntry = resources.lookupCache(path);
        } else {
            match = AlternateDocBase.findMatch(path, alternateDocBases);
            if (match != null) {
                cacheEntry = match.getResources().lookupCache(path);
            } else {
                // None of the url patterns for alternate docbases matched
                cacheEntry = resources.lookupCache(path);
            }
        }
View Full Code Here

Examples of org.apache.catalina.core.AlternateDocBase

                                file = context.resources.lookup(pathStr);
                            } catch(NamingException nex) {
                                // Swallow not found, since this is normal
                            }
                        } else {
                            AlternateDocBase match =
                                AlternateDocBase.findMatch(pathStr,
                                    context.alternateDocBases);
                            if (match != null) {
                                try {
                                    file = match.getResources().lookup(pathStr);
                                } catch(NamingException nex) {
                                    // Swallow not found, since this is normal
                                }
                            } else {
                                // None of the url patterns for alternate
                                // docbases matched
                                try {
                                    file = context.resources.lookup(pathStr);
                                } catch(NamingException nex) {
                                    // Swallow not found, since this is normal
                                }
                            }
                        }

                        if (file != null && !(file instanceof DirContext) ) {
                            internalMapExtensionWrapper(extensionWrappers,
                                                        path, mappingData);
                            if (mappingData.wrapper == null
                                && context.defaultWrapper != null) {
                                mappingData.wrapper =
                                    context.defaultWrapper.object;
                                mappingData.requestPath.setChars
                                    (path.getBuffer(), path.getStart(),
                                     path.getLength());
                                mappingData.wrapperPath.setChars
                                    (path.getBuffer(), path.getStart(),
                                     path.getLength());
                                mappingData.requestPath.setString(pathStr);
                                mappingData.wrapperPath.setString(pathStr);
                            }
                        }
                    }
                }

                path.setOffset(servletPath);
                path.setEnd(pathEnd);
            }
                                       
        }


        // Rule 7 -- Default servlet
        if (mappingData.wrapper == null && !checkJspWelcomeFiles) {
            if (context.defaultWrapper != null) {
                mappingData.wrapper = context.defaultWrapper.object;
                mappingData.requestPath.setChars
                    (path.getBuffer(), path.getStart(), path.getLength());
                mappingData.wrapperPath.setChars
                    (path.getBuffer(), path.getStart(), path.getLength());
            }
            // Redirection to a folder
            char[] buf = path.getBuffer();
            if (handleFolderRedirects && context.resources != null
                    && buf[pathEnd -1 ] != '/') {
                Object file = null;
                String pathStr = path.toString();

                if (context.alternateDocBases == null
                        || context.alternateDocBases.isEmpty()) {
                    try {
                        file = context.resources.lookup(pathStr);
                    } catch(NamingException nex) {
                        // Swallow, since someone else handles the 404
                    }
                } else {
                    AlternateDocBase match =
                        AlternateDocBase.findMatch(pathStr,
                            context.alternateDocBases);
                    if (match != null) {
                        try {
                            file = match.getResources().lookup(pathStr);
                        } catch(NamingException nex) {
                            // Swallow, since someone else handles the 404
                        }
                    } else {
                        // None of the url patterns for alternate
View Full Code Here

Examples of org.glassfish.grizzly.http.server.util.AlternateDocBase

        ProxyDirContext proxyDirContext = resources;
        if (alternateDocBases == null
                || alternateDocBases.size() == 0) {
            cacheEntry = proxyDirContext.lookupCache(path);
        } else {
            AlternateDocBase match = AlternateDocBase.findMatch(
                                            path, alternateDocBases);
            if (match != null) {
                cacheEntry = ((ProxyDirContext) ContextsAdapterUtility.unwrap(match.getResources())).lookupCache(path);
            } else {
                // None of the url patterns for alternate docbases matched
                cacheEntry = proxyDirContext.lookupCache(path);
            }
        }
View Full Code Here

Examples of org.glassfish.grizzly.http.server.util.AlternateDocBase

        if (urlPattern == null || docBase == null) {
            throw new IllegalArgumentException(rb.getString(MISS_PATH_OR_URL_PATTERN_EXCEPTION));
        }

        AlternateDocBase alternateDocBase = new AlternateDocBase();
        alternateDocBase.setUrlPattern(urlPattern);
        alternateDocBase.setDocBase(docBase);
        alternateDocBase.setBasePath(getBasePath(docBase));

        if (alternateDocBases == null) {
            alternateDocBases = new ArrayList<AlternateDocBase>();
        }
        alternateDocBases.add(alternateDocBase);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.