[thelist] JSP Help

Hassan Schroeder hassan at webtuitive.com
Tue Feb 1 11:04:26 CST 2005


RUST Randal wrote:

> Just for my own edification, how should it be done then?

Separation of data, presentation and logic (the MVC pattern) would
say just put that in *as HTML*. Your example had *no* variable data
within it at all, which makes it even worse :-)

Why have, for instance, this:

<%
   StringBuffer buf = new StringBuffer();

   buf.append("<table>");
   buf.append("<thead>");
   buf.append("<tr>");
   buf.append("<th>Check Number</th>");
   buf.append("<th>Payment Date</th>");
   buf.append("<th>Check Amount</th>");
   buf.append("<th>Payment Type</th>");
   buf.append("<th>Status</th>");
   buf.append("<th>In Letter</th>");
   buf.append("<th>Check Details</th>");
   buf.append("</tr>");
   buf.append("</thead>");
   buf.append("</table>");	
			
   out.println(buf.toString());	
%>

to simply create
<table><thead><tr><th>Check Number</th> .... when you can do it
directly? (and use the validation, syntax highlighting, etc. of
your preferred tool set, as well)

The whole *point* of JSP is to remove the need for things like that
first example...

-- 
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                           dream.  code.


More information about the thelist mailing list