From the MVC model the
- View is responsible for acting an interface/end point between you app and the exterior, most often it's a GUI of some sort
- The controller represents the dispatching part, and should be kept pretty light
- the Model treats you business logic, talks to the DB, etc.
Regarding you question about email validation, you should do it in two places, in the View/GUI via javascript, to ensure a quick and pretty feedback in the case the user enters a bad email address, and also to spare you the useless hits. But apart from this you must also do it somewhere server side. The actual logic for this would be in the Model layer, a method like isValidEmail(String emailAddress) that returns a boolean and is declared in the Model somewhere and gets called from the controller. I was Thinking of something along the lines of:
public void myAction() {
//we are in the controller
if(!Manager.isValidEmail(emailAddressAsString)) {
dispatchBadEmailView(); //dispatch to a bad email address view
}
}
This is my opinion, and also if you didn't already, try to use Spring MVC or something like this, it helps alot, read more here: http://www.mkyong.com/tutorials/spring-mvc-tutorials/