Package org.apache.catalina.core

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


                                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

TOP

Related Classes of org.apache.catalina.core.AlternateDocBase

Copyright © 2018 www.massapicom. 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.