Quoting Denis Bucher ([EMAIL PROTECTED]):

> My idea : adding some variables like said earlier, and those would be
> replaced by data coming from the database...
>
> BUT, what is the best solution, and which variables to put in the static
> file ?

There are a variety of fairly sophisticated template packages available
that do exactly this. You could write a simple one on your own, but if
you use an existing one, you will get something a lot more featurefull.

I wrote one called WebMacro:

   http://webmacro.org

which was selected by the Java Report as one of the top three servlet
packages of 1999. There is another one out there called FreeMarker,
though at the momemt FreeMarker's website appears down.

WebMacro works with beans and bean-like objects. It introspcts the
data you drop into a hashtable, determining what properties it has,
and allowing you to reference those properties in your template:

    $client.Name

could correspond to Customer.getName() for example. It also supports
looping, comes with a set of tools, etc.

Justin

___________________________________________________________________________
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