posted 16 years ago
Hi Ben, I saw the source code of the example given in Code Barn. Could you explain me the working of ControllerServlet.java
According to my understanding :
This ControllerServlet acts as a controller. In this servlet we are populating the model which in this case is ModelBean.We are setting the model in the request attribute which is modelBean. Then we are forwarding to view.jsp and passing the request and response. Please do clear my concepts.
I read that the controller performs some logic and then according to the result passes on the information to the view. Here where we are implementing some logic, we are simply passing the model to the view.
Another question, can I use Login validation as an example where I use a class Login as a Bean, then in the controller pass the username and password to the Login bean to do the validation. and then the bean passes on the result to the controller which according to the result passes on to the appropriate view.
I would like to clear my concept with a clear and simple example. Please do guide me. Thanks in advance.