I have a MVC application that receives an input from a form.
This is a login form so the only validation that is necessary is to check whether the input is non-empty.
Right now before I pass it to the model I validate it in the controller.
Is this a best practice or not? Does it belong to the model?
相关问题
- How to dynamically load partial view Via jquery aj
- Rails how to handle error and exceptions in model
- Laravel model returns “Undefined property: stdClas
- Name for a method that has only side effects
- Rails Models and unique combinations
相关文章
- 关于Asp.net Mvc Core重写Initialize方法的问题
- laravel create model from custom stub when using p
- Spring: controller inheritance using @Controller a
- Forward request from servlet to jsp
- Should client-server code be written in one “proje
- Algorithm for maximizing coverage of rectangular a
- superclass mismatch for class CommentsController (
- Disable action method from being called from the a
Assuming your application is structured like:
The user input would come to your controller, and you would use services in the service layer to validate it.