> I have yet to have time to really look at options like webmacro
> and freemarker, though they sound interesting and are on my short
> list. Packages like ECS (and IMHO, JSP) suffer the same fundamental
> problems as embedding the HTML in println statements in the java code.
> JSP minimizes the issue by reversing the situation and emphasizing use
> of JavaBeans, but it's still fundamentally flawed - in my opinion, of
> course.
HELLO! You don't have to use ECS for ALL of your pages or ALL of your
content. ;-) I'm not quite sure why people keep on getting hung up on that.
Imagine that you have a loop that is pulling data out of a ResultSet and
into a table...instead of typing the "<td>" tags into your code, why not
just use ECS to build your table in a nice OO manner?
In other words (pseudo code):
PrintWriter out = res.getWriter();
Table table = new Table();
while ( resultset.next() )
{
TR tr = new TR();
tr.addElement ( new TD().addElement ( resultset.getString(1) ) );
tr.addElement ( new TD().addElement ( resultset.getString(2) ) );
table.addElement ( tr );
}
table.output (out);
This is much cleaner IMHO than just putting a bunch of <table> or <tr> or
<td>'s into your code directly. I know it is possible to embed the HTML
around your logic, but that is gross and really hard to maintain imho.
You also have the advantage of doing all sorts of charset and filtering
conversions that ECS offers as well as easily serializing your code to store
it somewhere for use later (ie: caching the output of the page). What if
your data in your database contains stuff that should be converted to HTML
Entities? Why not use a package that makes it transparent to do it?
You can even use ECS in your JSP/WebMacro/FreeMarker/etc pages.
My point is that any time you have any sort of Html output where you are
generating the Html tags yourself in your code, you should replace that with
ECS.
-jon
___________________________________________________________________________
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