Originally posted by aakash bhatt: Why in MVC the controller is Servlet ? Why can't we use JSP for control as in turn it becomes servlet. Is there any other benefit using servlet? Regards, aakash
My $0.02 Since JSP should be used for presentation logic only, it makes more sense to use a servlet as a controller. Servlet process business logic and should be pure java code. But I've also seen cases in which you can use a JSP as a controller. Have a look at this article, there's a jsp named process.jsp that acts as a controller. Notice also that it does not have any presentation at all (HTML). It's got pure java code to forward the request to the appropiate destination. HTH [ September 16, 2003: Message edited by: Andres Gonzalez ]
I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
If you design your JSP poorly, it is possible for white space to 'leak' into the output buffer. As long as you remain under the buffer size you'll never know, but this is slightly less efficient. I have encountered the case where there was so much white space, the buffer was comitted and they were unable to forward. This was an extreme case, but it just won't happen in a Servlet.