Folks
> I totally agree ........ my code would've been around 60 kb if it wasn't for
> these out.println and the need to put the escape character \ on every " in
> the HTML output. Yukkkss!!!!! Thanks to all these tiresome and unneccessary
> (correct spelling ?) out.println formatting, the code is now close to 130
> kb. And that's after using a StringBuffer object to avoid typing out.println
> for every HTML line.....................
What you're talking about is the Perl feature called "Here document",
which uses lines instead of characters as delimiters, i.e.:
print <<HERE;
some lines of text
some lines of text
some lines of text
HERE
I think I've used this feature about twice, in almost-throwaway
quickie scripts. In every other CGI script I've done that involved
static HTML, I put the HTML in a separate file, loaded it into the
script, and substituted the programmatically generated stuff into it.
Which is the way I do it in servlets, although I ended up coding
a convenient string container that has the methods for searching and
substituting text, etc.
> Ohh and if anyone comes up with a reply that contains the word
> "webmacro", "freemarker", "ecs" and all that template/jsp crap, may
> you rot in hell!!! Please all you open source java gurus, put us
> servlet developers out of this println misery!
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.
Steven J. Owens
[EMAIL PROTECTED]
[EMAIL PROTECTED]
___________________________________________________________________________
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