FileDocCategorySizeDatePackage
HomeRenderer.javaAPI DocExample1167Sun Sep 02 14:59:06 BST 2001com.oreilly.forum.servlet

HomeRenderer

public class HomeRenderer extends Renderer
Shows the home page.

Fields Summary
Constructors Summary
Methods Summary
public voidrender(javax.servlet.http.HttpServlet servlet, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

        try {
            // get the data for the home page
            DataAdapter adapter = DataAdapter.getInstance();

            // an iterator of BoardSummary objects
            Iterator boards = adapter.getAllBoards();

            // convert the data into XML (a JDOM Document)
            Document doc = new Document(HomeJDOM.produceElement(boards));

            // apply the appropriate stylesheet
            XSLTRenderHelper.render(servlet, doc, "home.xslt", response);
        } catch (DataException de) {
            new ErrorRenderer(de).render(servlet, request, response);
        }