Hoople

Google Sitemap

Hoople allows you to easily specify which pages should be searchable and how they should be indexed. It can then be used to make the site searchable through an internal search engine, or to generate sitemaps for Google.

Add a “search” tag to your URL XML file. A “searchable” attribute is required that says whether the URLs should be searchable or not.

<?xml version='1.0'?>

<!DOCTYPE url PUBLIC "-//SUNDOG//DTD HOOPLE//EN" "http://www.sundog.net/hoople/dtd/hoople_1_0.dtd">

<url>
    <search searchable="true" lastmod="file" changefreq="monthly" priority="0.7"/>
<

If the search tag is not present or the searchable attribute is set to “false,” the URL will not be included in the sitemap.

Additional attributes let you specify methods that generate parameters needed for the URL as well as what to use for the last modified date and priority. See the DTD and/or the examples for more information.

Add a servlet mapping to your web.xml to generate a Google SiteMap

<servlet>
    <servlet-name>googleSiteMap</servlet-name>
    <servlet-class>net.sundog.hoople.servlet.GoogleSitemapServlet</servlet-class>
    <init-param>
        <param-name>include</param-name>
        <param-value>
            **/*.form,
            **/*.do,
            **/*.html,
        </param-value>
    </init-param>
</servlet>
<servlet-mapping>
    <servlet-name>googleSiteMap</servlet-name>
    <url-pattern>/sitemap.xml</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>googleSiteMap</servlet-name>
    <url-pattern>/sitemap.gz</url-pattern>
</servlet-mapping>

Note: You can map it to whatever url-patterns you want. If the url-pattern ends in a .gz it will compress it with gzip, otherwise it is uncompressed XML.