Chapter 15 of Professional Java Server Programming, © 1999 Wrox Press.

Common Weeds of the Carribean is an illustrated database of plants we observed in the village of El Limon in the Dominican Republic. Wrox Press has permitted me to reprint a book chapter I wrote about Common Weeds for Professional Java Server Programming.

Common Weeds is a sequel to Weeds of El Limon, which was was generated by a Java program that converted XML descriptions of weeds into static HTML pages. The software behind Common Weeds reads the XML weed descriptions and loads them into a MySQL database. It formats the descriptions with Java Server Pages (.jsp files) which access the database through Java Beans. I store fragments of free-formatted XML in TEXT columns in the database and Java servlets to retrieve images stored in BLOB columns.

I erase evidence of dynamic generation (URLs that end in .jsp or have /servlet/ in them.) using Apache's URL rewriting. This makes the site compatible with web crawlers, so I can make static copies of the site with w3mir and ensure that Common Weeds is indexed by search engines such as Altavista.

You can download a copy of our data and software here. You might also be interested in an older technical article about the original Weeds of El Limon.

Table of Contents

Weeds of El Limon 2 (Part 1)
    The problem
        The site
        How it works
        The unfriendly net
    The tools
    XML,  SQL and Java Objects (Part 2)
        XML:  the legacy application
        Mapping XML to SQL
            Storing XML fragments in the database
        The Weeds class
        Mapping a relational database to objects
        Creating and loading the database
    URL Rewriting and file layout
                What the pages look like to a web browser
                What's really on the server
    JSP and Java Beans (Part 3)
        index.jsp and common.jsp
        weeds.jsp
        error.jsp
        The Beans
    Serving images out of the database
        ViewWeed.java
        InsertImages.java
Conclusion

Part 1
Part 2
Part 3
Table of Contents

Chapter 15 of Professional Java Server Programming, © 1999 Wrox Press.
Produced by Honeylocust Media Systems, contact paul@honeylocust.com