Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 63485 invoked from network); 31 Jan 2011 22:51:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Jan 2011 22:51:37 -0000 Received: (qmail 75970 invoked by uid 500); 31 Jan 2011 22:51:33 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 75877 invoked by uid 500); 31 Jan 2011 22:51:32 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 75868 invoked by uid 99); 31 Jan 2011 22:51:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Jan 2011 22:51:32 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [76.96.30.80] (HELO qmta08.emeryville.ca.mail.comcast.net) (76.96.30.80) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Jan 2011 22:51:23 +0000 Received: from omta24.emeryville.ca.mail.comcast.net ([76.96.30.92]) by qmta08.emeryville.ca.mail.comcast.net with comcast id 2NSs1g0071zF43QA8Nr1pb; Mon, 31 Jan 2011 22:51:01 +0000 Received: from [192.168.1.201] ([69.143.109.145]) by omta24.emeryville.ca.mail.comcast.net with comcast id 2Nqz1g00o38FjT18kNr0Cm; Mon, 31 Jan 2011 22:51:01 +0000 Message-ID: <4D473CD6.5020002@christopherschultz.net> Date: Mon, 31 Jan 2011 17:51:02 -0500 From: Christopher Schultz User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Problem with standard taglibs after precompiling a web app with TCD in 7.0.6 & no support for "addWebXmlMappings" in jasper References: In-Reply-To: X-Enigmail-Version: 1.2a1pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John, On 1/31/2011 10:23 AM, John Bargos wrote: > Yeah, I checked that doc b4 starting, I also checked catalina.tasks in > catalina-ant.jar and the new jasper.jar libs in the deployer\lib, so > yesterday I thought the task def was ok and I was ready to compile. I've been playing with the JSP precompiler in 7.0.x and I'm working on an ant script that I hope will ship with Tomcat in the future. I'm including it in it's current form below. All you need to do is set catalina.home to Tomcat's home directory, set a "compile.classpath" for your webapp's libraries (probably WEB-INF/lib or whatever) and then set whatever "jspc.X" properties you want to set. Currently, it will generate a web.xml fragment, but if you set "jspc.jar.file", it will even generate a JAR file that you can drop into your WEB-INF/lib directory and don't have to do your own web.xml merge. Cool, right? A couple of VERY IMPORTANT notes: 1. This is currently experimental and not very flexible. I'm trying to see what I can get out of the code without modifying it. Keep reading. 2. You need to patch lib/jasper.jar!org/apache/jasper/resources/LocalStrings.properties like this (apologies for any wrapping... just read the patch and apply it manually: it's not that complicated): > Index: java/org/apache/jasper/resources/LocalStrings.properties > =================================================================== > --- java/org/apache/jasper/resources/LocalStrings.properties (revision 1063336) > +++ java/org/apache/jasper/resources/LocalStrings.properties (working copy) > @@ -265,31 +265,32 @@ > \ -source Set the -source argument to the compiler (default 1.6)\n\ > \ -target Set the -target argument to the compiler (default 1.6)\n\ > > -jspc.webxml.header=\n\ > +jspc.webxml.header=\n\ > \n\ > - -\ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"\n\ > -\ "http://java.sun.com/dtd/web-app_2_3.dtd">\n\ > + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n\ > + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee\n\ > + http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"\n\ > + version="3.0">\n\ > \n\ > \n\ > \n > jspc.webxml.footer=\n\ > -\n\ > -\n > -jspc.webinc.header=\n\ > +\n > +jspc.webinc.header=\n\ > +\n\ > + + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n\ > + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee\n\ > + http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd"\n\ > + version="3.0">\n\ > \n > jspc.webinc.footer=\n\ > -\n > +\n > jspc.webinc.insertEnd= > jspc.webinc.insertStart= > jspc.error.jasperException=error-the file ''{0}'' generated the following parse exception: {1} 3. It's very important that you your uriroot ("jsp.source.dir") have a WEB-INF/web.xml file that has the correct header in it, or you might get strange behavior: 4. You saw different code generated by the precompiler and Jasper running within Tomcat: that's because within Tomcat, Jasper can rely on certain things being available such as tag pools. The precompiler apparently does not do tag pooling. Don't worry too much about this right now. Now that you've read all the nastiness, here's the build script: JspC requires the following properties to be set: catalina.home=${catalina.home} jspc.target.dir=${jspc.target.dir} jspc.source.dir=${jspc.source.dir} Also, you need to have the following classpath reference set: <path id="jspc.classpath"> It should point to all of the classes and libraries referenced by your JSP sources. Let me know how it goes. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1HPNYACgkQ9CaO5/Lv0PAQXgCfSgSZ7zwFIgJW9rtkYDC/a1Uy 8aYAoKCiFx1ddRTbXNiYIOXPrR7ogndP =biHz -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org