<toc/>
</section>
-<section name="What is the DefaultServlet">
-<a name="what"></a>
+<section anchor="what" name="What is the DefaultServlet">
The default servlet is the servlet which serves static resources as well
as serves the directory listings (if directory listings are enabled).
</section>
-<section name="Where is it declared?">
-<a name="where"></a>
+<section anchor="where" name="Where is it declared?">
It is declared globally in <i>$CATALINA_BASE/conf/web.xml</i>.
By default here is it's declaration:
<source>
directory listings are enabled and debugging is turned off.
</section>
-<section name="What can I change?">
-<a name="change"></a>
+<section anchor="change" name="What can I change?">
The DefaultServlet allows the following initParamters:
<table border="1">
</table>
</section>
-<section name="How do I customize directory listings?">
-<a name="dir"></a>
+<section anchor="dir" name="How do I customize directory listings?">
<p>You can override DefaultServlet with you own implementation and use that
in your web.xml declaration. If you
can understand what was just said, we will assume you can read the code
</section>
-<section name="How do I secure directory listings?">
-<a name="secure"></a>
+<section anchor="secure" name="How do I secure directory listings?">
Use web.xml in each individual webapp. See the security section of the
Servlet specification.
<!-- Process a documentation section -->
<xsl:template match="section">
<xsl:variable name="name">
- <xsl:value-of select="@name"/>
+ <xsl:choose>
+ <xsl:when test="@anchor">
+ <xsl:value-of select="@anchor" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:variable>
<xsl:variable name="name2">
- <xsl:value-of select="translate($name, ' ', '_')"/>
+ <xsl:value-of select="translate($name, ' #', '__')"/>
</xsl:variable>
<table border="0" cellspacing="0" cellpadding="2">
<!-- Section heading -->
<!-- Process a documentation subsection -->
<xsl:template match="subsection">
<xsl:variable name="name">
- <xsl:if test="
- count(//*[(local-name()='section' or local-name()='subsection') and @name=current()/@name]) > 1
- ">
- <xsl:value-of select="concat(ancestor::section/@name, '/')"/>
- </xsl:if>
- <xsl:value-of select="@name"/>
+ <xsl:choose>
+ <xsl:when test="@anchor">
+ <xsl:value-of select="@anchor" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="
+ count(//*[(local-name()='section' or local-name()='subsection') and @name=current()/@name]) > 1
+ ">
+ <xsl:value-of select="concat(ancestor::section/@name, '/')"/>
+ </xsl:if>
+ <xsl:value-of select="@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:variable>
<xsl:variable name="name2">
- <xsl:value-of select="translate($name, ' ', '_')"/>
+ <xsl:value-of select="translate($name, ' #', '__')"/>
</xsl:variable>
<table border="0" cellspacing="0" cellpadding="2">
<!-- Subsection heading -->
<xsl:template mode="toc" match="section|subsection">
<xsl:variable name="name">
- <xsl:if test="local-name()='subsection' and
- count(//*[(local-name()='section' or local-name()='subsection') and @name=current()/@name]) > 1
- ">
- <xsl:value-of select="concat(ancestor::section/@name, '/')"/>
- </xsl:if>
- <xsl:value-of select="@name"/>
+ <xsl:choose>
+ <xsl:when test="@anchor">
+ <xsl:value-of select="@anchor" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="local-name()='subsection' and
+ count(//*[(local-name()='section' or local-name()='subsection') and @name=current()/@name]) > 1
+ ">
+ <xsl:value-of select="concat(ancestor::section/@name, '/')"/>
+ </xsl:if>
+ <xsl:value-of select="@name"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:variable>
<xsl:variable name="name2">
- <xsl:value-of select="translate($name, ' ', '_')"/>
+ <xsl:value-of select="translate($name, ' #', '__')"/>
</xsl:variable>
<li><a href="#{$name2}"><xsl:value-of select="@name"/></a>
<xsl:if test="subsection">