evergrean100
Technical User
I am trying to make sure I know what exactly is meant by the Model part of MVC design pattern.
Model is where you have the Business rules. For example if I had a Form in the Presentation part (JSP) that had a Field entry called Street and I only wanted the user to be able to enter one of three Streets then I could create a validation condition in my Model Bean Java class:
mymethod() would be called in the Servlet Controller.
Would this be a good example of Model code and/or Business logic that would be located in a Java Bean?
Model is where you have the Business rules. For example if I had a Form in the Presentation part (JSP) that had a Field entry called Street and I only wanted the user to be able to enter one of three Streets then I could create a validation condition in my Model Bean Java class:
Code:
public mymethod()
{
if((Street.equals("StreetOne") || (Street.equals("StreetTwo")) || (Street.equals("StreetThree")) {
//good selection
}
else
{
//invalid selection
}
}
mymethod() would be called in the Servlet Controller.
Would this be a good example of Model code and/or Business logic that would be located in a Java Bean?