the approach i've taken is to:
codify the form attributes in a property file
a FormManager class will derive the appropriate
html text provided a form property value
i store the FormMessage in the session so that
previously selected values are remembered, etc.
this works really nicely. we have a property management
framework which is threaded to read every few seconds
(nice for development) and i can readily change the form
elements at any time. the distinct form element types
(eg. type, name, value, etc) is really not all that large.
at the ui layer, i simply cast out a call to the form
manager to display element Foo using some of the session
context as default ... one simply line of java in the ui
layer per form element. then again, one could build another
layer which macro's these calls but that would make the
distinct html a bit more hidden.
now, i'm not driving this stuff from a database directly
but what i do, for example, is to read a customer record
from a db and call the FormManager to display the appropriate
from element using the customer data retrieved from the
database as a default.
there is one set of form elements i'd like to be completely
database driven (but not all form elements will be) and
i plan on simply caching aggregated property derived form
data with that dervided from a database.
hope this helps,
- james
;)MIME-Version: 1.0
;)Content-Transfer-Encoding: 7bit
;)X-Priority: 3
;)X-MSMail-Priority: Normal
;)X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
;)Date: Tue, 23 Feb 1999 16:22:50 -0500
;)From: "Jeffrey D. Curry" <[EMAIL PROTECTED]>
;)Subject: Fill HTML controls with data from database?
;)To: [EMAIL PROTECTED]
;)
;)I want to create an .SHTML document, say, in frontpage that contains list
;)boxes, check boxes etc.. The problem lies in the fact that I want to
;)populate those controls from a Servlet which, in the background, is
;)retrieving the data from the database.
;)
;)I know I can place the HTML in the Servlet itself, although maintenance
;)could get messy.
;)
;)Any ideas?
;)
;)Thanks
;)
;)_________________________________________________________________________
__
;)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