Hi i like to build web application and im trying to think about way to reduce cpu/memory what will be faster for tomcat to use servlets to get the requests and render back the HTML or using jsp ?
JSP has the advantage of seperating the presentation layer and business logic, and hence convinient at development. First time when JSP engine encounter JSP request, it convert JSP in servlet, compile it and the bytecode format it saves in JSP Container along with the time stamp. Due to this process the first time response of JSP as compaired to servlets is slower, much slower. But from next request onword JSP engine checks the time stamp of the request and of JSP compiled file in JSP Container in JVM, and if the file is not changed then it redirects this request to that class file. And client get the response. In case of servlet the compiled servlet, ie class files are stored in Servlet Container in JVM. As both servlet and JSP is handled with same processes and sharing the resourses (JVM), there is no difference in performance of both. Altough i know and feel it this way but if really there is a difference i am curious to know them