You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jeff Cai <Je...@symantec.com> on 2014/06/06 11:36:50 UTC

How to add jstl.jar to the jasper task

Hi,

Jstl.jar should be added to the classpath of jasper task which is defined in ${tomcat_home}/bin/catalina-tasks.xml.
How can I add the jstl.jar to the task's classpath in Ant?

Best Regards

Jeff Cai

NBU Appliance Beijing, Symantec Corporation
www.symantec.com<http://www.symantec.com/>
________________________________

Office: (86) 10-62725992  Mobile: (86) 186-110-88935
Jeff_Cai@symantec.com
________________________________

[cid:image001.png@01CF81AD.E1F37D70]<http://www.symantec.com/>
________________________________

[cid:image002.png@01CF81AD.E1F37D70]<http://twitter.com/symantec> [cid:image003.png@01CF81AD.E1F37D70] <http://www.facebook.com/Symantec>  [cid:image004.png@01CF81AD.E1F37D70] <http://www.linkedin.com/company/symantec?trk=tabs_biz_home>  [cid:image005.png@01CF81AD.E1F37D70] <http://www.youtube.com/symantec>  [cid:image006.jpg@01CF81AD.E1F37D70] <http://www.symantec.com/tv/allvideos/>  [cid:image007.png@01CF81AD.E1F37D70] <http://www.symantec.com/connect/>  [cid:image008.png@01CF81AD.E1F37D70]  [cid:image009.png@01CF81AD.E1F37D70]  [cid:image010.png@01CF81AD.E1F37D70]  [cid:image011.png@01CF81AD.E1F37D70]  [cid:image012.png@01CF81AD.E1F37D70]

This message (including any attachments) is intended only for the use of the individual or entity to which it is addressed and may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute as attorney work product. If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, notify us immediately by telephone and (i) destroy this message if a facsimile or (ii) delete this message immediately if this is an electronic communication.


RE: How to add jstl.jar to the jasper task

Posted by Jeff Cai <Je...@symantec.com>.

-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net] 
Sent: Tuesday, June 10, 2014 12:54 AM
To: Tomcat Users List
Subject: Re: How to add jstl.jar to the jasper task

* PGP Signed by an unknown key

Jeff,

On 6/9/14, 1:39 AM, Jeff Cai wrote:
> Snip ...
> 
> 
> Try setting "classPath" attribute on <jasper> element.
> 
> http://svn.apache.org/viewvc/tomcat/tc7.0.x/tags/TOMCAT_7_0_54/java/or
> g/apache/jasper/JspC.java?view=markup#l766
>
>  Best regards, Konstantin Kolinko
> 
> 
> Konstantin, Thanks for your information.
> 
> Now I can include the jar file through specifying the CLASSPATH 
> attribute in the build file. But another new issue comes out:
> 
> When building the following code, it reports error.
> 
> <h3>Iterating over a range</h3> <c:set var="num" value="20" /> 
> <c:forEach var="item" begin="1" end="${num}"> ${item} </c:forEach>
> 
> BUILD FAILED /home/jeffcai/ant_test/build.xml:13:
> org.apache.jasper.JasperException: java.lang.NumberFormatException:
> For input string: "${num}"
> 
> This error happens on Tomcat 7.0.54 while not on 8.0.8.

What does your taglib declaration look like?

-chris

Chris,

I added web.xml under WEB-INF, then the error went away.

Thanks.

Jeff

* Unknown Key
* 0xA53CA458(L)

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


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


Re: How to add jstl.jar to the jasper task

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Jeff,

On 6/9/14, 1:39 AM, Jeff Cai wrote:
> Snip ...
> 
> 
> Try setting "classPath" attribute on <jasper> element.
> 
> http://svn.apache.org/viewvc/tomcat/tc7.0.x/tags/TOMCAT_7_0_54/java/org/apache/jasper/JspC.java?view=markup#l766
>
>  Best regards, Konstantin Kolinko
> 
> 
> Konstantin, Thanks for your information.
> 
> Now I can include the jar file through specifying the CLASSPATH
> attribute in the build file. But another new issue comes out:
> 
> When building the following code, it reports error.
> 
> <h3>Iterating over a range</h3> <c:set var="num" value="20" /> 
> <c:forEach var="item" begin="1" end="${num}"> ${item} </c:forEach>
> 
> BUILD FAILED /home/jeffcai/ant_test/build.xml:13:
> org.apache.jasper.JasperException: java.lang.NumberFormatException:
> For input string: "${num}"
> 
> This error happens on Tomcat 7.0.54 while not on 8.0.8.

What does your taglib declaration look like?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTleaqAAoJEBzwKT+lPKRYsOIP+gK0+1b4Vx/D21tBRuc39N0A
6oHNL0Bcx/huAeEInyinf6h6GtAbvc62UwZqj5JjRw7XrG7UtnbNfrD/ZoF5kbDD
TBaoqaSZb+8xy8BMsgrKRSK91LTFz5wyVwumMEnRfWBFvmpFlLOenft+SEAsxsvs
wyjGCwygzzI7Yg1JbRhuWimSmWYshK27DSYsvR5foNY55s8fio/jOoBEVBQfFWXB
sua1ET02/4+Qbvnth+u0B3jAJl+zGRa+MsnsQ/LKVwxu2vICpy4jKxKiyHW6Hltz
sQgaVAjShj+57R0l0F81Nq1kTKdzM80ac+YPNWBBry5clwoRW8UbCs4DGWzNPNsx
gP5SelMuFCfPxL7Xi4O1AwdKMZNG2EtTeGqtKj9i72AXhgupTyh1WDcLewUvj9c3
KabLxs0ZqxS4koCTBD77LNPTCEs1V8sW4p420wBrbIXkXu+8xV3+isZb7o07VghT
rlUas+CgtKBCeWMzNi/EcMCKDFBEc1sc+bYVRE5+baLXUKCfaywMpF1ISDGjGWtb
kk3HrQphkyH5E9YOfzYp2GIRXbVdycaZRlm0FgmDvJUPnPKSw4JXvEGFCLA2Jkdy
fHQ8WyNcc1MTpXCh+RgiOwEw1YXFshMPdngEWws9XQHSr31YWhix7rjBXg6gd/fz
gzNqXeOSddXkUp4w69GI
=elu3
-----END PGP SIGNATURE-----

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


RE: How to add jstl.jar to the jasper task

Posted by Jeff Cai <Je...@symantec.com>.
Snip ...


Try setting "classPath" attribute on <jasper> element.

http://svn.apache.org/viewvc/tomcat/tc7.0.x/tags/TOMCAT_7_0_54/java/org/apache/jasper/JspC.java?view=markup#l766

Best regards,
Konstantin Kolinko


Konstantin, Thanks for your information.

Now I can include the jar file through specifying the CLASSPATH attribute in the build file. But another new issue comes out:

When building the following code, it reports error.

    <h3>Iterating over a range</h3>
    <c:set var="num" value="20" />
    <c:forEach var="item" begin="1" end="${num}">
        ${item}
    </c:forEach>

BUILD FAILED
/home/jeffcai/ant_test/build.xml:13: org.apache.jasper.JasperException: java.lang.NumberFormatException: For input string: "${num}"

This error happens on Tomcat 7.0.54 while not on 8.0.8.

Jeff



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


Re: How to add jstl.jar to the jasper task

Posted by Konstantin Kolinko <kn...@gmail.com>.
2014-06-06 14:33 GMT+04:00 Jeff Cai <Je...@symantec.com>:
>>>
>>> Jstl.jar should be added to the classpath of jasper task which is defined in ${tomcat_home}/bin/catalina-tasks.xml.
>>>
>>> How can I add the jstl.jar to the task’s classpath in Ant?
>>>
>>
>>
>> 1. What for?
>>
>> 2. Put jstl.jar into WEB-INF/lib of your webapp.
>>
>> 3. You can always copy-paste the content of catalina-tasks.xml into your own build file and adjust it as you wish.
>>
>> 4.
>> http://tomcat.apache.org/lists.html#tomcat-users
>> -> Please format your messages as plain text, not HTML.
>
> -> 1. Your exact version number of Apache Tomcat =?
> -> 5. Do not top-post.
>
> How do you use jasper? A fragment of your build.xml = ?
>
> In my home /home/jeffcai, I created a test directory ant_test.
>
> The content file /home/jeffcai/ant_test/build.xml
>
> As long as I put jstl.jar under the uriroot/WEB-INF/lib, it can pass successfully.
>
> -------------------------------------------------------------------------------------------------------------------------
>
> <project name="Webapp Precompilation" default="all" basedir=".">
>
>    <property name="tomcat.home" value="/home/jeffcai/software/apache-tomcat-8.0.8" />
>    <import file="${tomcat.home}/bin/catalina-tasks.xml"/>
>
>    <target name="jspc">
>
>     <jasper
>              validateXml="false"
>              uriroot="/home/jeffcai/software/apache-tomcat-7.0.54/webapps/examples/jsp/tagplugin"
>              outputDir="/tmp/tagplugin/WEB-INF/src" />
>   </target>

Try setting "classPath" attribute on <jasper> element.

http://svn.apache.org/viewvc/tomcat/tc7.0.x/tags/TOMCAT_7_0_54/java/org/apache/jasper/JspC.java?view=markup#l766

Best regards,
Konstantin Kolinko

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


RE: How to add jstl.jar to the jasper task

Posted by Jeff Cai <Je...@symantec.com>.

-----Original Message-----
From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com] 
Sent: Friday, June 06, 2014 6:19 PM
To: Tomcat Users List
Subject: Re: How to add jstl.jar to the jasper task

2014-06-06 14:06 GMT+04:00 Jeff Cai <Je...@symantec.com>:
> Since my source directory is not under the webapp, I have to copy the jar file to the WEB-INF/lib in the source directory.
> Is there any other ways to include the jar file besides copy/paste?
>
> Jeff
>
> -----Original Message-----
> From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com]
> Sent: Friday, June 06, 2014 5:43 PM
> To: Tomcat Users List
> Subject: Re: How to add jstl.jar to the jasper task
>
> 2014-06-06 13:36 GMT+04:00 Jeff Cai <Je...@symantec.com>:
>>
>> Hi,
>>
>> Jstl.jar should be added to the classpath of jasper task which is defined in ${tomcat_home}/bin/catalina-tasks.xml.
>>
>> How can I add the jstl.jar to the task’s classpath in Ant?
>>
>
>
> 1. What for?
>
> 2. Put jstl.jar into WEB-INF/lib of your webapp.
>
> 3. You can always copy-paste the content of catalina-tasks.xml into your own build file and adjust it as you wish.
>
> 4.
> http://tomcat.apache.org/lists.html#tomcat-users
> -> Please format your messages as plain text, not HTML.

-> 1. Your exact version number of Apache Tomcat =?
-> 5. Do not top-post.

How do you use jasper? A fragment of your build.xml = ?

In my home /home/jeffcai, I created a test directory ant_test.

The content file /home/jeffcai/ant_test/build.xml

As long as I put jstl.jar under the uriroot/WEB-INF/lib, it can pass successfully.

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

<project name="Webapp Precompilation" default="all" basedir=".">

   <property name="tomcat.home" value="/home/jeffcai/software/apache-tomcat-8.0.8" />
   <import file="${tomcat.home}/bin/catalina-tasks.xml"/>

   <target name="jspc">

    <jasper
             validateXml="false"
             uriroot="/home/jeffcai/software/apache-tomcat-7.0.54/webapps/examples/jsp/tagplugin"
             outputDir="/tmp/tagplugin/WEB-INF/src" />
  </target>

  <target name="all" depends="jspc">
  </target>

  <target name="cleanup">
    <delete>
        <fileset dir="tagplugin/WEB-INF/src"/>
        <fileset dir="tagplugin/WEB-INF/classes/org/apache/jsp"/>
    </delete>
  </target>

</project>

Thanks.

Jeff

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

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


Re: How to add jstl.jar to the jasper task

Posted by Konstantin Kolinko <kn...@gmail.com>.
2014-06-06 14:06 GMT+04:00 Jeff Cai <Je...@symantec.com>:
> Since my source directory is not under the webapp, I have to copy the jar file to the WEB-INF/lib in the source directory.
> Is there any other ways to include the jar file besides copy/paste?
>
> Jeff
>
> -----Original Message-----
> From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com]
> Sent: Friday, June 06, 2014 5:43 PM
> To: Tomcat Users List
> Subject: Re: How to add jstl.jar to the jasper task
>
> 2014-06-06 13:36 GMT+04:00 Jeff Cai <Je...@symantec.com>:
>>
>> Hi,
>>
>> Jstl.jar should be added to the classpath of jasper task which is defined in ${tomcat_home}/bin/catalina-tasks.xml.
>>
>> How can I add the jstl.jar to the task’s classpath in Ant?
>>
>
>
> 1. What for?
>
> 2. Put jstl.jar into WEB-INF/lib of your webapp.
>
> 3. You can always copy-paste the content of catalina-tasks.xml into your own build file and adjust it as you wish.
>
> 4.
> http://tomcat.apache.org/lists.html#tomcat-users
> -> Please format your messages as plain text, not HTML.

-> 1. Your exact version number of Apache Tomcat =?
-> 5. Do not top-post.

How do you use jasper? A fragment of your build.xml = ?

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


RE: How to add jstl.jar to the jasper task

Posted by Jeff Cai <Je...@symantec.com>.
Since my source directory is not under the webapp, I have to copy the jar file to the WEB-INF/lib in the source directory.
Is there any other ways to include the jar file besides copy/paste? 

Jeff

-----Original Message-----
From: Konstantin Kolinko [mailto:knst.kolinko@gmail.com] 
Sent: Friday, June 06, 2014 5:43 PM
To: Tomcat Users List
Subject: Re: How to add jstl.jar to the jasper task

2014-06-06 13:36 GMT+04:00 Jeff Cai <Je...@symantec.com>:
>
> Hi,
>
> Jstl.jar should be added to the classpath of jasper task which is defined in ${tomcat_home}/bin/catalina-tasks.xml.
>
> How can I add the jstl.jar to the task’s classpath in Ant?
>


1. What for?

2. Put jstl.jar into WEB-INF/lib of your webapp.

3. You can always copy-paste the content of catalina-tasks.xml into your own build file and adjust it as you wish.

4.
http://tomcat.apache.org/lists.html#tomcat-users
-> Please format your messages as plain text, not HTML.

Best regards,
Konstantin Kolinko

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


Re: How to add jstl.jar to the jasper task

Posted by Konstantin Kolinko <kn...@gmail.com>.
2014-06-06 13:36 GMT+04:00 Jeff Cai <Je...@symantec.com>:
>
> Hi,
>
> Jstl.jar should be added to the classpath of jasper task which is defined in ${tomcat_home}/bin/catalina-tasks.xml.
>
> How can I add the jstl.jar to the task’s classpath in Ant?
>


1. What for?

2. Put jstl.jar into WEB-INF/lib of your webapp.

3. You can always copy-paste the content of catalina-tasks.xml into
your own build file and adjust it as you wish.

4.
http://tomcat.apache.org/lists.html#tomcat-users
-> Please format your messages as plain text, not HTML.

Best regards,
Konstantin Kolinko

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