Hi,

i think u write a request handler class.
controller servlet should paas on the request to this class where u will
check for the null values.
in this request handler class you can call a method of a data access class
for DB updation.

I think it will work just fine.

Cheers !!
raj

-----Original Message-----
From: ericdev [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 06, 2001 1:57 AM
To: [EMAIL PROTECTED]
Subject: MVC in detail, advantages


scenario:
Need to sign up a user. What is the right way of doing so in the MVC? I
assume the following:

Java Server Pages Model 2 Semantics
1) Input.jsp : has no java bean, forwards to controller jsp
2) Controller jsp : looks around for parameter passed, and forwards again to
right place
should do error checking here, to avoid persisting to beans, in the case of
faulty input
3) View.jsp : has beans, sets default properties in beans, persist to db

if i process later in controller...
- i need to pass the request values so wastes the http server (small loss,
performance wise)
- i need to send myself back to the initial page with a message that is not
user friendly on location. (medium loss)
- i separate input logic versus parsing logic (medium gain, coding wise)
- may need a bean to intercept non unique usernames connecting thought
connection pool (medium loss, perfomance wise)

if i process initially in input...
- may need a bean to intercept non unique usernames connecting thought
connection pool (medium loss, perfomance wise)
- no separate input logic versus parsing logic (medium loss, coding wise)
- doesnt pass around crazily (medium gain performance wise)

So the question is this :
1) I need to error check for field required values being null somewhere.
Where?
2) I need to connect to a DB to check for user ID uniqueness. Where do i do
this?
3) Is this a good application of the MVC? Should I just call back to the
same JSP page and dump the MVC?

Eric Dunn
[EMAIL PROTECTED]
Software Engineer
ZBE, Incorporated

===========================================================================
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://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".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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