Phil,

I've been using GUI beans which are responsible for validating all data
submitted via the web.  If all the dat is valid, then the business
functionality is completed, and flow moves on.  If any data is invalid, the
original JSP page is regenerated.  The page itself is responsible for
checking which particular pieces of data are invalid and generating the
appropriate error messages.

Given that the GUI bean and the JSP page are quite closely tied together, it
might seem somewhat arbitrary that we choose this approach, but for
Localization purposes, this actually works out better - I can include my
error messages (which require localization) along with my normal content
(which requires localization in the normal course of things anyway).

-AMT


> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Phil Swenson
> Sent: Tuesday, March 21, 2000 9:08 PM
> To: [EMAIL PROTECTED]
> Subject: Validation patterns
>
>
> I'm curious as to what kind of patterns people are using for data
> validation
> in JSPs?  I assume most would have beans to the validation... say you are
> taking credit card information for an order (CC #, CC Expiration date,
> billing address, email).  Would you have the bean throw an
> expection to the
> JSP and have the JSP print an error msg?  Or would have have
> validation bean
> that would generate the error msg?  Can someone point me to some
> examples/patterns?  Is it better to put the error msgs in the JSP
> or in the
> beans.  I can argue both ways...better to put in bean because it is
> centralized so if you have more than one way to change properties
> of a bean
> the same error msg is displayed....or better to put in JSP
> because the HTML
> coders can easily change the msgs and have full control over them.
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

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

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to