📄 org_apache_catalina_startup_contextruleset--rosonsandy.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0055)http://rosonsandy.blogdriver.com/rosonsandy/879859.html -->
<HTML><HEAD><TITLE>org.apache.catalina.startup.ContextRuleSet--rosonsandy</TITLE>
<META http-equiv=Content-Type content="text/html; charset=GBK">
<META http-equiv=Pragma content=no-cache>
<META http-equiv=Cache-Control content=no-cache>
<META http-equiv=Expires content=0>
<META
content="org.apache.catalina.startup.Catalinaorg.apache.catalina.startup.ContextRuleSetLifecycleListener in Tomcat 博客 博客动力 blog blogdriver blogger 中国"
name=description>
<META
content="rosonsandy org.apache.catalina.startup.Catalinaorg.apache.catalina.startup.ContextRuleSetLifecycleListener in Tomcat 博客 博客动力 blog blogdriver blogger 中国"
name=keywords><LINK
href="org_apache_catalina_startup_ContextRuleSet--rosonsandy.files/diary.css"
type=text/css rel=stylesheet>
<SCRIPT language=JavaScript
src="org_apache_catalina_startup_ContextRuleSet--rosonsandy.files/UBB.js"></SCRIPT>
<SCRIPT
src="org_apache_catalina_startup_ContextRuleSet--rosonsandy.files/blog.js"
type=text/javascript></SCRIPT>
<META content="MSHTML 6.00.2900.3199" name=GENERATOR></HEAD>
<BODY>
<DIV id=container>
<DIV id=header>
<H1 class=title><A
href="http://rosonsandy.blogdriver.com/rosonsandy/index.html">rosonsandy</A></H1></DIV>
<DIV id=category><A title=上一篇
href="http://rosonsandy.blogdriver.com/rosonsandy/879651.html">org.apache.catalina.startup.Catalina</A>-
-| <A href="http://rosonsandy.blogdriver.com/rosonsandy/index.html">回首页</A> | <A
href="http://rosonsandy.blogdriver.com/rosonsandy/catalog_2005.html">2005年索引</A>
| - -<A title=下一篇
href="http://rosonsandy.blogdriver.com/rosonsandy/879907.html">LifecycleListener
in Tomcat</A></DIV>
<DIV class=entity>
<H2 class=diaryTitle>org.apache.catalina.startup.ContextRuleSet- -</H2>
<P>
<P>
<P>这里我把defaultContext相关的删除了,觉得增加defaultContext破坏了整个服务器的结构。当然除了改这里是不够的。</P>
<P>package org.apache.catalina.startup;</P>
<P><BR>import java.lang.reflect.Constructor;<BR>import
java.lang.reflect.Method;<BR>import org.apache.catalina.Container;<BR>import
org.apache.catalina.Context;<BR>import org.apache.catalina.Loader;<BR>import
org.apache.catalina.Wrapper;<BR>import
org.apache.catalina.deploy.SecurityConstraint;<BR>import
org.apache.commons.digester.Digester;<BR>import
org.apache.commons.digester.Rule;<BR>import
org.apache.commons.digester.RuleSetBase;<BR>import org.xml.sax.Attributes;</P>
<P><BR>/**<BR> * <p><strong>RuleSet</strong> for
processing the contents of a<BR> * Context or DefaultContext definition
element. To enable parsing of a<BR> * DefaultContext, be sure to
specify a prefix that ends with "/Default".</p><BR> *<BR> *
@author Craig R. McClanahan<BR> * @version $Revision: 1.4 $ $Date:
2003/10/21 00:22:57 $<BR> */</P>
<P>public class ContextRuleSet extends RuleSetBase {</P>
<P><BR> //
----------------------------------------------------- Instance Variables</P>
<P><BR> /**<BR> * The matching pattern
prefix to use for recognizing our elements.<BR>
*/<BR> protected String prefix = null;</P>
<P><BR> //
------------------------------------------------------------ Constructor</P>
<P><BR> /**<BR> * Construct an
instance of this <code>RuleSet</code> with the
default<BR> * matching pattern
prefix.<BR> */<BR> public
ContextRuleSet() {</P>
<P> this("");</P>
<P> }</P>
<P><BR> /**<BR> * Construct an
instance of this <code>RuleSet</code> with the
specified<BR> * matching pattern
prefix.<BR> *<BR> * @param
prefix Prefix for matching pattern rules (including
the<BR> * trailing slash
character)<BR> */<BR> public
ContextRuleSet(String prefix) {</P>
<P>
super();<BR> this.namespaceURI =
null;<BR> this.prefix = prefix;</P>
<P> }</P>
<P><BR> //
--------------------------------------------------------- Public Methods</P>
<P><BR> /**<BR> * <p>Add the set
of Rule instances defined in this RuleSet to the<BR> *
specified <code>Digester</code> instance, associating them
with<BR> * our namespace URI (if any). This method
should only be called<BR> * by a Digester
instance.</p><BR> *<BR> *
@param digester Digester instance to which the new Rule
instances<BR> * should be
added.<BR> */<BR> public void
addRuleInstances(Digester digester)
{<BR> <FONT
style="BACKGROUND-COLOR: #ffffff"> digester.addObjectCreate(prefix +
"Context",<BR>
"org.apache.catalina.core.StandardContext",<BR>
"className");<BR>
digester.addSetProperties(prefix + "Context");</FONT></P>
<P><FONT
style="BACKGROUND-COLOR: #ffffff">
<FONT color=#006600>//StandardContext.setParentClassLoader(classLoader)
[HostRuleSet一样]</FONT><BR> digester.addRule(prefix
+
"Context",<BR>
new
CopyParentClassLoaderRule(digester));<BR>
<FONT color=#006600>//Watch
out!Context.addLifecycle(ContextConfig) </FONT></FONT><FONT
style="BACKGROUND-COLOR: #ffffff"><FONT
color=#006600> [EngineRuleSet,HostRuleSet一样]<BR></FONT>
digester.addRule(prefix +
"Context",<BR>
new
LifecycleListenerRule<BR>
(digester,<BR>
"org.apache.catalina.startup.ContextConfig",<BR>
"configClass"));<BR></FONT>
digester.addSetNext(prefix +
"Context",<BR>
"addChild",<BR> digester.addCallMethod(prefix
+
"Context/InstanceListener",<BR>
"addInstanceListener", 0);</P>
<P> digester.addObjectCreate(prefix +
"Context/Listener",<BR>
null, // MUST be specified in the
element<BR>
"className");<BR>
digester.addSetProperties(prefix +
"Context/Listener");<BR>
digester.addSetNext(prefix +
"Context/Listener",<BR>
"addLifecycleListener",<BR>
"org.apache.catalina.LifecycleListener");</P>
<P> digester.addRule(prefix +
"Context/Loader",<BR>
new
CreateLoaderRule<BR>
(digester,<BR>
"org.apache.catalina.loader.WebappLoader",<BR>
"className"));<BR>
digester.addSetProperties(prefix +
"Context/Loader");<BR>
digester.addSetNext(prefix +
"Context/Loader",<BR>
"setLoader",<BR>
"org.apache.catalina.Loader");</P>
<P> digester.addObjectCreate(prefix +
"Context/Logger",<BR>
null, // MUST be specified in the
element<BR>
"className");<BR>
digester.addSetProperties(prefix +
"Context/Logger");<BR>
digester.addSetNext(prefix +
"Context/Logger",<BR>
"setLogger",<BR>
"org.apache.catalina.Logger");</P>
<P> digester.addObjectCreate(prefix +
"Context/Manager",<BR>
"org.apache.catalina.session.StandardManager",<BR>
"className");<BR>
digester.addSetProperties(prefix +
"Context/Manager");<BR>
digester.addSetNext(prefix +
"Context/Manager",<BR>
"setManager",<BR>
"org.apache.catalina.Manager");</P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -