Hi,
>
> [...Element Construction Set...]
>
Hi,
This sort of project looks worthwhile - sort of a Java version of CGI.pm. It
lets you code like:
doc.appendBody(new H1("Demo Header"));
I think that something more high-level is needed, though. I've been working on a
small HtmlDoc class that I use in my servlets for simple output. It lets me
write code like:
HtmlDoc doc = new HtmlDoc("Middleware Server Status Report");
doc.setRefresh(refresh);
doc.appendSection("Server Registry", serverMap);
doc.appendSection("DTD Registry", dtdMap);
doc.appendSection("State Database", stateDatabase);
return doc.toString();
This is now a semantically higher level, now. It's not too flexible right now,
but that's ok, because for the time, it produces mainly debugging output. I can
imagine implementing it with the ECS. Here's a couple of other ideas, I've been
thinking over, though:
1. After looking at what I'm doing, maybe the best way to implement this HtmlDoc
class is to create a DOM, and then the HtmlDoc.toString() method would format the
XML with a HTML-generating XSL stylesheet.
2. My implementation of appendSection(String, Object) makes the string an H1, and
calls the object's toString() which is appended to the document. I could
configure it with a list of HTML renderers, though, similar to Swing's JTable.
Then, the object's toString() would only get called as a last resort if no
renderer is available.
3. setRefresh() causes a META refresh tag to be created. Other web page
'functions' can be supported like this.
- Robb
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html