tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter L <punchy....@gmail.com>
Subject Re: Recursive Tagfile and JSP Precompilation
Date Fri, 02 Dec 2005 00:55:19 GMT
Thanks Tim but it doesn't appear to be entirely resolved...

Long story short:
- Tried to precompile using the jbossweb-tomcat55.sar from jboss-4.0.3
- Same problem (I think its Tomcat-5.5.12)
- Upgraded jars to Tomcat-5.5.13
- Got an error during compilation of actual tag file (instead of the
client JSP):
C:\dev\J2EE\libraryserver\build.xml:819: org.apache.jasper.JasperException:
/WEB-INF/tags/jspTags/displayValue.tag(27,88)
Unable to load tag handler class
"org.apache.taglibs.standard.tag.rt.core.SetTag" for tag "c:set"

 - Discovered a workaround and have reverted back to native
jbossweb-tomcat50.sar


Here is the workaround:
 - Need to 'snip' the compile time tracing of recursion by the use of
<jsp:include>
 - Create a JSP file that simply calls the tag using parameters
supplied in request attribs
 - 'include' this JSP instead of performing a recursive call in the tag file
 - BEWARE CAVEAT: relative paths don't work inside a tagfile

Example JSP:
<%@page errorPage="/error.jsp"
  %><%@ taglib tagdir="/WEB-INF/tags/jspTags" prefix="slk"
  %><slk:displayValue value="${requestScope.recurseParamMap.value}"
                      property="${requestScope.recurseParamMap.property}"
                     
defaultValue="${requestScope.recurseParamMap.defaultValue}"/>

Example Tagfile snippet:
<%java.util.Map recurseParamMap = new java.util.HashMap();
recurseParamMap.put("value", SOME_OBJECT);
request.setAttribute("recurseParamMap", recurseParamMap);
%><jsp:include page="/WEB-INF/tags/jspTags/recursion/displayValue.jsp"/>

Cheers,
Pete

On 12/1/05, Tim Funk <funkman@joedog.org> wrote:
> IIRC - this is fixed in 5.5. I'm not sure if it was fixed with 5.5.12 - but
> 5.5.13 was just tagged and should be available soon. BUT it hasn't been voted
> how stable it is yet. (beta, alpha, stable)
>
> -Tim
>
> Peter L wrote:
> > Hello,
> > I'm trying to precompile JSP's for a JBoss(4.0.1) / Tomcat(5.0) server
> > and everything is cool except I get a ClassNotFoundException when a
> > Recursive Tagfile is encountered....
> >
> > [jasper2] SEVERE: ERROR-the file
> > '\WEB-INF\pages\templates\resolveResultsDialog.jsp' generated the
> > following general exception:
> > [jasper2] java.lang.ClassNotFoundException:
> > org.apache.taglibs.standard.tlv.JstlCoreTLV
> > [jasper2]     at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
> > [jasper2]     at java.security.AccessController.doPrivileged(Native Method)
> > [jasper2]     at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> > [jasper2]     at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
> > [jasper2]     at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
> > [jasper2]     at
> > org.apache.jasper.compiler.TagLibraryInfoImpl.createValidator(TagLibraryInfoImpl.java:645)
> > [jasper2]     at
> > org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:246)
> > [jasper2]     at
> > org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:162)
> >    <omitted for brevity>
> >
> > If I comment out the actual line of recursion inside the tag file I
> > can generate, compile, deploy and use all the servlets just fine
> > (except for the missing functionality).
> >
> > I understand we use a jstl.jar and a standard.jar that are a little
> > suspect.  But given that there are no other similar jars available
> > during the process then it should be fine (That and I upgraded them to
> > 1.1.2 temporarily and got the same result).
> >
> > Questions:
> > - Why does dynamic compilation work?  What is Tomcat doing differently?
> > - Is there a Jasper configuration inside Tomcat I can inspect? (I
> > couldn't find it in server.xml)
> >
> > Bonus Questions:
> > - Is there an easy way to precompile jsp's (for error checking and
> > initial speed) and retain runtime customizability?
> > - Will this rash ever go away? </kidding>
> >
> > Thank you in advance for your consideration / help,
> > Pete

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


Mime
View raw message