I had a thought in one of my other posts and wanted to start it's own thread. With the limited JSP/Servlet coding I have done, it seems that there are times when we request a JSP page and time when we request a Servlet. And then JSP pages calls Servlets and Servlets forward to JSP pages. Well, what if you ALWAYS called a JSP page. So let's say you had Page1.JSP Page1.class The first thing that Page1.JSP page does is call Page1.class. Page1.class does all the initial work that the JSP page might need to do. Like get info from a database, get values for form data, etc. Then it forwards back to the Page1.jsp. Those familiar with ASP.NET will recognize this a bit. I am just wondering if there would be too much overhead with the extra calls to possibly empty servlets. Or if it would be moot. Any comments?
I'm pretty sure it's a moot point... remember, a compiled jsp page IS a servlet. For small things going from JSP to JSP works fine for me; but on more complex issues, I just find working with a servlet cleaner and neater. Mark Stein
Hi Gregg, The choice of a MVC/or any other design pattern is a matter of total choice. These design patterns are used to provide a template of solution for a specific problem. No one forces you to use any pattern. Based on the type of project you are working on the design choice is totally yours provided you consider all possible future aspects of the under consideration project. Means if you are simply writing code for some test or practice it's easy to call another JSP from one JSP, but should not do that for bigger projects.
SCJP, SCJD, SCWCD1.4, IBM486, IBM484, IBM 483, IBM 287, IBM141, IBM Certified Enterprise Developer - WebSphere Studio, V5.0
Author of IBM 287 Simulator Exam