Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: Validating form input in Beans.


Message #1 by "Nick" <nickm@s...> on Mon, 18 Jun 2001 14:34:04 -0500
I'll take a stab at it.

Where I work we implemented a web-enabled solution using the MVC
(Model-View-Controller) architecture. The "Model" component consists of
entities that handle business logic, session objects and presentation
objects (implemented using Java Beans). The "View" component is solely web
pages incorporating HTML,Javascript and JSP that use the component parts of
the "Model" to present the data (and a UI) to the user. The "Controller" is
the functional component that does all the dirty work to associate the model
components with the View (implemented using Servlet technology in Java). It
makes the most sense to put your "validation" logic in your "Model"
component in this architecture. Since the "Model" was implemented using Java
(in our case), specifically Java Beans, the bean is the logical choice for
input form validation. We developed a task class that embodied classes for
handling input forms (and their validation), database requests, browser
presentation and other mini-tasks associated with a web app. This task was
used by the controller to link the view and model together.

Hope this explains a little bit, albeit from my current perspective.

John Owen
Federal TransTel
Senior Developer


-----Original Message-----
From: Naumann Yousuf [mailto:nauman_yousuf@d...]
Sent: Tuesday, June 19, 2001 6:33 AM
To: Pro_JavaServer_Pages
Subject: [pro_jsp] RE: Validating form input in Beans.


beans

[Moderator's note: anyone want to expand on *why* the original poster
 should use beans?]

> -----Original Message-----
> From: Nick [mailto:nickm@s...]
> Sent: Tuesday, June 19, 2001 12:34 AM
> To: Pro_JavaServer_Pages
> Subject: [pro_jsp] Validating form input in Beans.
> 
> 
> Hi:
> 
> I have been trying to decide wether I should validate form data 
> in beans or
> use a midiator jsp or servlet then pass the response back to 
> another jsp to
> display any errors. What would you guys suggest?
> 
> Thanks,
> 
> Stefan


  Return to Index