I'll like to get an insight reagarding a design pattern.
Sometime speople use taglib concepts of JSP to call a Java Bean which internally gets data from the ejb tier (in general from the model). The contol flows like this -
The request comes to servlet,
The servlet handles the request to the appropriate JSP,
The JSP gets the data from the model tier using taglib/Java Beans etc.
The alternate approach is -
The request come to servlet,
Servlet passes the request to Model tier using command pattern/business delegate pattern etc and get the data.
Then appropriate JSP is called. The data (which is obtained in the previous step) to be populated in JSP is passed through the request object itself.
Can anyone please tell me which one is the better approach ?