开发者

what is faster to use jsp or servlets for web app

i like to build web application and im trying to think about way to reduce cpu/memory what will be faste开发者_如何学Gor 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜