• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP x Servlets

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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");...
 
Gustavo Adolpho Bonesso
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lasse,
Do you know something about the treatment that Websphere give when compile jsp? By the way, do you have any tip about where i can see the compiled servlet ?
Tank you !
 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic