Is it OK to call a Session Facade (or a Business Delegate) directly from a JSP (without going through a controller)? Let's say I have a JSP which needs to get some user data to display in a page. Using Struts, I can have an action make the call to my facade and put the resulting value bean into the request and then forward to my JSP. On the other hand, I can just access the JSP directly and have it get the data it needs by calling the facade directly. The latters seems much easier, especially when I don't know who will be linking to my page. Is this approach OK?
In the JSP I have:
... some html ...
It will definitely work but is not a good design practice and not a recommended way to do it.
Why? This is called Dispatcher View in the Core J2EE Design patterns book. I'm just trying to figure out when it's better to use Dispatcher View and when to use Service to Worker.
yes I think this is absolutely ok as ATG dynamo has implemented the same thing with their predefined tags.
lol. I dont know if I would look to ATG dynamo as a reference for good programming standards.