Clive Hayward wrote:

> > 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.....................
> >
> > 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!
> >
>
> You could put the pieces of html code in separate files.  Then read the
> files into variables and write the output to the PrintWriter.
>
> Not really an ideal solution either.
>

Of course, that is exactly what a template engine or JSP environment effectively
does for you :-) -- but you also get variable substitutions, conditional logic
tags, and all the other bells and whistles provided by the tool you choose.
Personally I prefer JSP for all my dynamically generated HTML, because it inverts
the whole issue (you embed a little Java in your HTML, instead of a lot of HTML in
your Java), but to each their own.

Doing a "print qq" type of solution, copied from PERL, would require a drastic
change in the nature of the Java language itself, because it would require the
basic structure of a Java program to be just like PERL's built-in structure:  read
from standard input, do some stuff, and copy to standard output.  To say that such
a change would be impractical and unpopular with O-O oriented developers who like
Java is probably a *little* bit of an understatement.....

If the original author really wants "print qq", I would suggest that he stick with
PERL and CGI scripts, since he likes it so much.  If he's willing to learn some
new technologies that might require new ways of thinking, Java and servlets, and
the associated templating technologies, are a good place to be.


>
> --
> Clive Hayward
>

Craig McClanahan

___________________________________________________________________________
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

Reply via email to