Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jsp compilation  RSS feed

 
Soman Singh
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
What are pre-compiled Jsp's?
Thanks in advance...
 
Faisal Khan
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Soman,
As you may know JPSs are compiled the first time a user requests the JSP page (it gets converted into a servlet). This has performance implications, therefore one can pre-compile the JSP pages so users do not have to wait for anything.
HTH
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would I do this?
 
Nagendra Prasad
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pre-compiling JSPs is a feature provided by tge application server on which u would want to host these pages.
For instance on IBM Websphere there is a script called JSPCompile.sh which does this for you.
YOu would need to check the app server specific documentation for this.
 
Soman Singh
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help.
As Mr. Prasad said it's a feature related to Apps server ...
What I had thought is when the jsp is first compiled it gets
compiled in to servlet. This compiled filed remains in the Temp
folder of JBoss-Tomcat (the apps. server of which I am aware).
So every time we run the app server,it gets loaded automatically.
But this not true.
Help me out to clear the confusion.
Regards,
sos
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you say this is not true?
 
Nischal Tanna
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Precompiled jsp is nothing but a servlet class file.A web Server can be taken as a container having 2 seperate containers .one for a jsp and another for a servlet.The very first time a jsp page is requested,the web server searches for the class file i.e., whether the jsp has been compiled before in the servlet container n if dosent exist goes to jsp container.So the next time the class file is picked up from the servlet container n hence faster execution at the server side.
I hope this clears ur idea.
Regards,
Nischal
 
Ashok Mash
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, pre-compiling JSP's as a part of a build process (long before deployment) is also advisable, as it will help the developer to weed out all syntax errors at the build stage instead of finding them while testing after deployment etc.
HTH
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, if you invoke your jsp with the parameter
jsp_precompile=true
the container tranlates the JSP and compiles the servlet that is generated without executing the servlet. This is very useful when testing.
http://localhost:8080/yourwebapp/yourjsp?jsp_precompile=true
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!