Hi folks,

     I know a fair bit about servlets and web programming, but this is
my first serious venture into JSP land.  I have a vague idea that
there is a commonly-used pattern for handling forms, could somebody
point me in the right direction?

     The problem I'm trying to solve is this; I have a database with a
dozen or more tables.  For each table, I need to provide code to
display, create, edit, validate and update table entries.  I could do
this the old-fashioned way, by writing four or five different JSPs for
each table.  However, this results in a lot of grunt work and in the
end I have to keep each set of JSPs in agreement, plus the table.  If
I change a column, I have to make that change in six different places.

     It occurs to me that there's a better way.  I could swear I've
seen mention of this in passing, in the JSP world, at some point in
the past.  Essentially this would involve a single JSP for each
table.  The <FORM> in that JSP would have several JSP tags for each
<INPUT> tag.  It'd have:

     the <INPUT> tag itself,

     a tag to insert default values into the <INPUT> tag
     when creating a new row

     a tag to populate the <INPUT> with existing values, if
     the JSP is invoked with an existing row

     a tag to save the submitted value for that <INPUT> to
     the database

     a tag to validate the submitted value for that <INPUT>;
     this tag would also display an error message, if the
     value failed validation


     Is this a commonly used pattern in the JSP world?  Are there any
particular tags or taglibs used to implement it?  Could people point
me to some good tutorials or examples?

Steven J. Owens
[EMAIL PROTECTED]

"I'm going to make broad, sweeping generalizations and strong,
 declarative statements, because otherwise I'll be here all night and
 this document will be four times longer and much less fun to read.
 Take it all with a grain of salt." - Me at http://darksleep.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to