8 Replies Latest reply on May 22, 2012 10:32 AM by bsudhananthan

    What JSP compiler for JBoss 7.1.*

    rkite01

        Which JSP compiler should we use for JBoss 7.1.0CR1?   I migrated from JBoss 4.2.3 and am using apache ant for builds. 

        I was pre-compiling our pages with org.apache.jasper.JspC which was part of jboss-web in JBoss 4.x.   

        • 1. Re: What JSP compiler for JBoss 7.1.*
          jaikiran
          • 2. Re: What JSP compiler for JBoss 7.1.*
            rkite01

              If you could provide a link with an answer to my question that would be great.

            • 3. Re: What JSP compiler for JBoss 7.1.*
              sfcoy

              If you follow the footprints you will see Re: JspC for JBoss 6 M4, which basically says that it won't be supported.

               

               

              {quote}In J2EE 6 it is _very_ hard to precompile JSP. So there isn't going to be a JspC for AS6+{quote}

              • 4. Re: What JSP compiler for JBoss 7.1.*
                rjanapala

                Hi Kite,

                 

                Did you find any solution about precompiling JSP pages in JBOSS-AS-7.1. If got, Could please share those details.

                 

                Thanks you..

                • 5. Re: What JSP compiler for JBoss 7.1.*
                  guinotphil

                  I can compile with the follwing ant task, using Tomcat 7, not JBoss Web 7. However JBoss Web is based on Tomcat and the generated class files looked very similar.

                  But I can recomand this only for validation, not for production.

                   

                   

                   

                   

                  <project name="precompil" default="all" basedir=".">

                     <dirname property="project.dir" file="${ant.file.precompil}/.."/>

                            <property name="webapp.path" value="${project.dir}/WebContent" />

                            <property name="output.dir" value="${project.dir}/precompile" />

                            <property name="jboss.home" value="C:/DEV/jboss-as-7.1.0.Final" />

                            <property name="m2.repo" value="C:/DEV/.m2/repository" />

                   

                              <taskdef classname="org.apache.jasper.JspC" name="jasperNew">

                        <classpath id="jspc.classpath">

                           <fileset dir="${m2.repo}/org/apache/tomcat/tomcat-jasper/7.0.21"><include name="*.jar"/></fileset>

                           <fileset dir="${m2.repo}/org/apache/tomcat/tomcat-api/7.0.21"><include name="*.jar"/></fileset>

                           <fileset dir="${m2.repo}/org/apache/tomcat/tomcat-jsp-api/7.0.21"><include name="*.jar"/></fileset>

                           <fileset dir="${m2.repo}/org/apache/tomcat/tomcat-util/7.0.21"><include name="*.jar"/></fileset>

                           <fileset dir="${m2.repo}/org/apache/tomcat/tomcat-juli/7.0.21"><include name="*.jar"/></fileset>

                           <fileset dir="${m2.repo}/org/apache/tomcat/tomcat-jasper-el/7.0.21"><include name="*.jar"/></fileset>

                   

                   

                           <fileset dir="${jboss.home}/modules/javax/servlet/api/main"><include name="*.jar"/></fileset>

                           <fileset dir="${jboss.home}/modules/javax/servlet/jsp/api/main"><include name="*.jar"/></fileset>

                           <fileset dir="${jboss.home}/modules/javax/servlet/jstl/api/main"><include name="*.jar"/></fileset>

                           <fileset dir="${jboss.home}/modules/javax/el/api/main"><include name="*.jar"/></fileset>

                           <fileset dir="${jboss.home}/modules/javax/jms/api/main"><include name="*.jar"/></fileset>

                           <fileset dir="${jboss.home}/modules/javax/mail/api/main"><include name="*.jar"/></fileset>

                           <fileset dir="${jboss.home}/modules/javax/faces/api/1.2"><include name="*.jar"/></fileset>

                           <fileset dir="${jboss.home}/modules/com/sun/jsf-impl/1.2"><include name="*.jar"/></fileset>

                           <!-- add here all the other module your JSP depends on -->

                   

                   

                           <fileset dir="${jboss.home}/standalone/deployments/PhaseII_Global_EAR_AS7.ear/lib"><include name="*.jar"/></fileset>

                   

                          </classpath>

                      </taskdef>

                   

                            <target name="clean-target">

                                      <delete dir="${output.dir}/org" />

                            </target>

                   

                   

                            <target name="jspc">

                                      <jasperNew

                               validateXml="false"

                               uriroot="${webapp.path}"

                               webXmlFragment="${output.dir}/WEB-INF/web.xml"

                               outputDir="${output.dir}" />

                    </target>

                   

                    <target name="all" depends="clean-target, jspc" />

                  </project>

                  • 6. Re: What JSP compiler for JBoss 7.1.*
                    bsudhananthan

                    Thanks  guinotphil                       , its  working.

                     

                    Any one please give the correct solution to pre-compile JSP in jboss as 7 using jboss web api. I googled a lot but i can't find a solution.

                     

                     

                    Thanx in advance.

                    • 7. Re: What JSP compiler for JBoss 7.1.*
                      jaikiran

                      sudhananthan B wrote:

                       

                       

                      Any one please give the correct solution to pre-compile JSP in jboss as 7 using jboss web api. I googled a lot but i can't find a solution.

                       

                      https://community.jboss.org/message/735536#735536

                      • 8. Re: What JSP compiler for JBoss 7.1.*
                        bsudhananthan

                        Thanks jaikiran pai .

                         

                         

                        Please Correct me if i'm wrong. As specified in the thread https://community.jboss.org/message/735536#735536 there is no support available to compile JSP in jboss-web.7.0.1. For that we have to use Tomcat 7 version to pre-compile jsp. If so we have to add  these additional jars of Tomcat in order to perform pre-compilation of JSP.