Loading
JSP PreCompilation

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  What is Pre-Compilation of JSPs , why do we need that?


Ans)

As we all know JSP will be compiled and converted into Servlets upon their First time access,
this degrades the Performance. So to avoid this in Real Time Applications, JSP are compiled
and converted into Servlets Classes while deploying the Application.

Weblogic :
Place the following in weblogic.xml. precompile

<jsp-descriptor>
  <jsp-param>
    <param-name>precompile</param-name>
    <param-value>true</param-value>

  </jsp-param>
</jsp-descriptor>

Tomcat :
Use this in your Build.xml
 
 <taskdef classname="org.apache.jasper.JspC" name="jasper" >
     <classpath>
         <pathelement location="${java.home}/../lib/tools.jar"/>
         <fileset dir="${ENV.CATALINA_HOME}/lib">
             <include name="*.jar"/>
         </fileset>
         <path refid="myjars"/>
      </classpath>
 </taskdef>

 <jasper verbose="0"
          package="my.package"
          uriroot="${webapps.dir}/${webapp.name}"
          webXmlFragment="${build.dir}/generated_web.xml"
          outputDir="${webapp.dir}/${webapp.name}/WEB-INF/src/my/package" />



more info...       Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

JSP PreCompilation


JSP PreCompilation

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free