|
What this is
Other links
The source code/* * Copyright 1999-2004 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tomcat.facade; import java.util.Enumeration; import java.util.Hashtable; import javax.servlet.ServletConfig; import org.apache.tomcat.core.BaseInterceptor; import org.apache.tomcat.core.Context; import org.apache.tomcat.core.Handler; import org.apache.tomcat.core.TomcatException; import org.apache.tomcat.util.collections.EmptyEnumeration; import org.apache.tomcat.util.depend.DependManager; import org.apache.tomcat.util.depend.Dependency; /** * Class used to represent a servlet inside a Context. * * It will deal with all servlet-specific issues: * - load on startup * - servlet class name ( dynamic loading ) * - init parameters * - security roles/mappings ( per servlet ) * - jsp that acts like a servlet ( web.xml ) * - reloading * * @author James Duncan Davidson [duncan@eng.sun.com] * @author Jason Hunter [jch@eng.sun.com] * @author James Todd [gonzo@eng.sun.com] * @author Harish Prabandham * @author costin@dnt.ro */ public final class ServletInfo { // the actual tomcat handler associated with this servlet private ServletHandler handler; // facade private ServletConfig configF; // optional informations private String description = null; private Hashtable securityRoleRefs=new Hashtable(); private Hashtable initArgs=null; // should be removed from handler private String jspFile = null; private int loadOnStartup=-1; private boolean loadingOnStartup=false; public ServletInfo() { handler=new ServletHandler(); handler.setServletInfo( this ); } public ServletInfo( ServletHandler handler ) { this.handler=handler; handler.setServletInfo( this ); } public String toString() { return "SW (" + jspFile + " CN=" + handler.getServletClassName() + ")"; } // -------------------- Configuration hook /** This method can called to add the servlet to the web application. * ( typlically used from the config - WebXmlReader ). */ public void addServlet(Context ctx, WebXmlReader wxR) throws TomcatException { // set the owner module for the servlet. // Even if the servlets are defined in WebXmlReader, they should // belong to Servlet22Interceptor. ( it's easy to set WebXmlReader, // but it's more intuitive to set debug and options on Servlet22 ) BaseInterceptor mods[]=ctx.getContainer().getInterceptors(); for( int i=0; i |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.