Programmer's Rules

Java EE

Automatic on demand generator of a sitemap.xml in a Java EE servlet

Solution for having an up-to-date sitemap in a web application written in Java

Java EEwebJava

Create a servlet in your java source package. I named the class SiteMapServlet.java.

In my structure the servlet is located in com.algorytmika.servlets.

Write into the class the similar code:

Next add your servlet to your web.xml descriptor

Now calling your page like http://algorytmika.com/sitemap.xml you can see your sitemap. Check my sitemap.xml here
Tutorial statistics