Just to offer some anecdotal evidence...

I did just exactly what John talks about.  I have an object called
"TextFileInliner" that allows me to insert data into an HTML template file
at insertion points that I have marked up with a specially formatted HTML
comment tag.

I then extended that object with "CachingTextFileInliner" so that the HTML
templates could be read in just once in the servlet init() method.

Then, I created an object called "WebGui" that takes a
CachingTextFileInliner, an HttpServletResponse, and an array of String (the
data to inline at the HTML template insertion points), and sends the whole
thing back to the client.  (Complete with the buffering HTTP 1.1 capable
keep-alive technique described in J.H.'s servlet book...)

And John is right - it works wonderfully!

I never have to put _any_ HTML into my Java code.  I just use my favorite
HTML GUI creation tool, placing the insertion point tags at the points in
the HTML code where I want to dynamically inline data with the servlet.

Yes, I developed this system awhile ago, before JSP was around.  But I still
use it because it works so well, and it has much better runtime performance
than JSP does.  (Just from my personal observation, no flames, please.)

The current system is array indexed, not mapped with key/value pairs.  It's
slightly less flexible, but at a huge increase in performance.  Anyway, it
suits my needs very well.

--
Shad J. Aumann
190 Earle Drive
North Kingstown, RI 02852
[EMAIL PROTECTED]

> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of John
> McDonald
> Sent: Tuesday, August 10, 1999 8:19 PM
> To: [EMAIL PROTECTED]
> Subject: Re: out.println(".....");? "EASY is the word!!!"
>
>
> My thoughts exactly. I'm the originator of this post, and I guess I should
> have been more specific from the beginning. I would like and API, through
> which I can use a simple tag, like print qq, to output HTML data to a web
> page. Peter hit the nail on the head when he said that the products
> (templates, API's) available today are quite difficult to use and are not
> for the mainstream. I am fairly familiar with Java, however I am
> NOT a guru,
> but I grow to love the language more and more daily. I would like
> a way for
> someone, who is new to java, to be able to easily post dynamic
> data to there
> web(extranet, intranet, ecommerce, business to business VPN
> ecommerce) page
> quickly and efficiently, like Perl has the ability to do. I learned the
> fundamentals of Perl in about two weeks. I've been working with
> Java for six
> months and have yet to be able to post dynamic web data in an efficient
> manner without MUCH laborious out.println("...") coding.
>
> So I POST this question again....in a different light. How difficult would
> it be to come up with a 100% pure java API which would encompass
> fundamental
> HTML(<head><body><table> would be a great start) and then make
> calls to this
> API just like we do with every other darn OO language. Or, how about we
> store the data in a txt file, something in the java.io package to
> just read
> the entire file into the script, and then output that to the web? Great
> idea.
>
> If anyone knows how to do this, please let me know.
>
>
>
> John D. McDonald
> Phone: 415-703-8800 x 342
> Fax:      415-703-8801
> email:    [EMAIL PROTECTED]
> web:     www.InfoSolv.net
> InfoSolv, Inc.
> Web Security Consulting
> Integration and Training
>
> -----Original Message-----
> From: Peter <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> Date: Tuesday, August 10, 1999 6:02 AM
> Subject: Re: out.println(".....");? "EASY is the word!!!"
>
>
> >>I have tought that webmacro, freemaker etc. are too complex to be used
> >>by me.
> >
> >That's exactly my point!!!! Why can't these stuff be a bit
> easier ? Things
> >dont have to be complicated to be used. Instead of offering alternatives,
> >most of you guys just keep pushing your webmacro, jsp,
> freemarker cr*p down
> >our throats. The strangest thing is that, most of these template
> tools web
> >sites dont provide easy AND workable examples on their
> functionality. Most
> >are just plain ads coupled with convoluted examples and the
> infamous Hello
> >world servlet. Please .......
> >
> >So when people like yours truly complaint on how complicated they are to
> >use, then came forth those derogatory remarks such as "unreformed perl
> >programmer", "messy coder" etc-etc ....... well go ahead and
> make yourself
> >feel superior by trashing out at us .......
> >
> >I really hope that in the future, servlet development will not be so
> painful
> >and messy as it is at the present.
> >
> >_________________________________________________________________
> __________
> >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
> >
>
> __________________________________________________________________
> _________
> 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
>

___________________________________________________________________________
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