I�m using servlets instead of JSP pages, because i have a lot of code made im cgi format, using Java in the legace system. I�m rewriting some programs, but i have some doubts about performance. There�s performance diference between JSP pages and Servlets rendering the page with the same functionality ? Thank�s
Originally posted by Gustavo Adolpho Bonesso: [is] There�s performance diference between JSP pages and Servlets rendering the page with the same functionality ?
On the first request to the JSP -- you might experience a lag as the application server translates and then compiles the JSP. But subsequent requests will be just as fast as a Servlet. This problem can be overcome by simply pre-compiling the JSPs.
Gustavo Adolpho Bonesso
Joined: May 11, 2002
Thank you, Jessica, and sorry about my english mistake (i speak portuguese, and always change "is there" by "there is", wich is the question form of my born language).
If you're really keen to performance tuning, you should remember that even though the JSP gets compiled into a servlet, the JSP compiler usually generates a lot of unnecessary out.println's into the servlet. For example with WebLogic's JSPC compiler, the resulting servlet sources are full of out.println("\r");...
i don't know about WebSphere, but most servlet containers have an intermediate directory where the servlet code is created... this is then comiled into servlet bytecode. Some servers (like Tomcat, I believe) call this directory "work". The admin interface to the WebSphere server should allow you to set the location of the work directory, or at least see what the default location is.
Philip Shanks, SCJP - Castro Valley, CA
My boss never outsources or has lay-offs, and He's always hiring. I work for Jesus! Prepare your resume!
Joined: Jan 23, 2002
There's a little trick for getting to know where the generated servlet sources are... It's called "put a syntax error in the JSP and see where the error message points". This works at least with WebLogic 6.1 (its compiler refers to a __mypage_jsp.java in a temporary directory called something like .wlnotdelete/foo12345.war/...) You could try that with WebSphere also. I actually have WebSphere installed in my linux box but I guess it has some "keep-generated" option disabled because I can't find any generated sources.