Ok,
editing conf/web.xml and adding compiler=modern does not change anything.

"modern" is extracted from tomcat 7 & ant documentation
https://tomcat.apache.org/tomcat-7.0-doc/jasper-howto.html#Introduction
https://ant.apache.org/manual/Tasks/javac.html

(extract from vanilla conf/web.xml, see compiler init param)
<servlet>
    <servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
      <param-name>fork</param-name>
      <param-value>false</param-value>
    </init-param>
    <init-param>
      <param-name>xpoweredBy</param-name>
      <param-value>false</param-value>
    </init-param>
    <init-param>
      <param-name>mappedfile</param-name>
      <param-value>true</param-value>
    </init-param>
*    <init-param>**
**      <param-name>compiler</param-name>**
**      <param-value>modern</param-value>**
**    </init-param>*
    <load-on-startup>3</load-on-startup>
  </servlet>


At runtime, i still have jsp 65k limit error, no changes.


Seems that "compiler" option did not effects....


Meanwhile, i've reworked ant script to bypass any possibile "jasper tag" pre definitions under netbeans, and simplified the task.

<target depends="clean,dist" description="Test compile JSP pages with jasper2 to expose compilation errors." name="pre-compile-jsps-jasper2">

        <path id="cp" >
            <pathelement location="${build.web.dir}/WEB-INF/classes"/>
            <fileset dir="${build.web.dir}/WEB-INF/lib">
                <include name="*.jar"/>
            </fileset>
<pathelement location="/home/agharta/netbeans-8.1/apache-tomcat-7.0.72/lib"/> <fileset dir="/home/agharta/netbeans-8.1/apache-tomcat-7.0.72/lib">
                <include name="*.jar"/>
            </fileset>
<fileset dir="/home/agharta/netbeans-8.1/apache-tomcat-7.0.72/bin">
                <include name="*.jar"/>
            </fileset>
        </path>

        <property  name="xx" refid="cp"/>

<taskdef name="customjasper" classname="org.apache.jasper.JspC" classpath="${xx}"/>

        <echo level="error">Classpath is: ${xx}</echo>

        <!-- compiler="modern" not added, used JDT insead??-->
        <customjasper validateXml="false" compile="true" classpath="${xx}"
                      uriroot="${build.web.dir}"
                      outputDir="${build.web.dir}/src"  />

    </target>

org.apache.jasper.JspC has taken from default tomcat's ant/catalina.tasks file.


So, compilation works fine.

The flag compile="true" in customjasper tag means to invoke java to class compilation. And effectively i can see both .java and .class files in my dir tree.

Now, when ant jasper compiles files, what compiler type use it? JDT or something like ant default "modern"? (note: Tomcat 7)

If JDT, why compilation works fine?
If not JDT, how to force JDTCompiler?


Thanks again,
Agharta













On 09/27/2016 12:10 PM, Mark Thomas wrote:
On 27/09/2016 10:50, agharta wrote:
Hi,
Thanks for reply.

This could be a nice test to do. And i do it :-)

Sorry my poor skill, how to set Jasper to use javac?
And vice-versa, how to set ant to use Eclipse?
Jasper to use javac:
- set the compiler init parameter in $CATALINA_BASE/conf/web.xml
- see http://tomcat.apache.org/tomcat-9.0-doc/jasper-howto.html

It has been a while since I've done this but the docs for the compiler
attribute should tell you everything you need.

Mark



Thanks a lot,
Best regards,
Agharta


On 09/27/2016 11:45 AM, Mark Thomas wrote:
On 27/09/2016 09:58, agharta wrote:
<snip/>

So, errors comes up only at runtime compilation. Why?
Compiler differences. Pre-compilation uses Javac. Runtime compilation
uses the compiler from Eclipse (by default).

Another option to consider would be to run Tomcat on a JDK and configure
Jasper to compile with javac.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Reply via email to