Many feel that when using MVC, code in a JSP which performs a task not directly related to presentation (such as business logic, validation, error handling, etc.) probably belongs elsewhere. For example, the most natural home for validation code is the Model Object.
This is a specific example of a general guideline of lasting value - the idea of separating the "layers" of the application : the user interface, the business logic or model, and the database. The underlying reason for this separation is, ultimately, to allow people with different skills to make significant and effective contributions to the development of an application. User interface designers should be concerned almost entirely with presentation issues, while a database expert should be concerned almost entirely with writing SQL.
(See as well the package by feature, not layer topic.)