You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jim Henderson <jg...@metafile.com> on 2003/04/04 23:21:53 UTC

Tomcat 4.1.18->4.1.24 causes standard tag to fail

I had been running my application with Tomcat 4.1.18 (full version) and Java
1.4.1_2-b06 under Redhat Linux 8 without problems.
However, once I switched to Tomcat 4.1.24 (full version) I get the following
error first time a page is displayed:

----------------------------
org.apache.jasper.JasperException: /jsp/FolderPage.jsp(88,7) No such tag
import in the tag library imported with prefix c
	at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.
java:94)
	at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:428
)
	at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:219
)
	at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:705)
	at org.apache.jasper.compiler.Parser.parseElements(Parser.java:804)
----------------------------

The .jsp page is as follows (parts removed):

----------------------------
<%@ page language="java"  contentType="text/html" %>
<%@ taglib prefix="MFnet" uri="mfnettags.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
<HTML>
   <HEAD>
      <TITLE>FolderPage</TITLE>
      <META http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
   </HEAD>
   <BODY bgcolor="#FFFFFF" text="#000000"
onLoad="javascript:updateStatus();">
       <MFnet:findDocuments
              userID                  = "<%= userID %>"
              libraryName             = "<%= searchLib %>"
              searchStmt              = "<%= searchStmt %>"
              webSearchID             = "<%= searchKey %>"
              startDatePriorUnit      = "<%= searchBackUnit %>"
              startDatePriorUnitCount = "<%= searchBackCount %>"
       />
       <c:import url="treeFolder.xsl" var="stylesheet" />
       <x:transform xslt="${stylesheet}" > <%= xmlFolderInfo %>
</x:transform>
   </body>
</html>
----------------------------

Anyone know what happened between 4.1.18 and 4.1.24 of Tomcat that would
cause the error?  I deployed my application in both versions the same way (I
retraced my steps twice).  The first JSP page (does not use any standard
tags) is generated OK.

My application's .war file contains the core tag library.


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


RE: Tomcat 4.1.18->4.1.24 causes standard tag to fail

Posted by jo...@fwd.at.
hi jim,

I had the same trouble when running jspc using ant.

Simply replacing the absolute URI (which BTW points nowhere at the sun 
website) with a relative URI:
<%@ taglib prefix="c" uri = "/WEB-INF/c.tld" %>

and supplying the c.tld file (below) solved the whole issue easily.
It  has the additional advantage you know what's really in the tld, not 
only a generic absolute uri pointing nowhere.
And... you can use ant to run JSPC!

Make sure you add the c.tld to the webapps' WEB-INF directory.

==========================
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib
  PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
  "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>
  <tlib-version>1.0</tlib-version>
  <jsp-version>1.2</jsp-version>
  <short-name>c</short-name>
  <uri>http://java.sun.com/jstl/core</uri>
  <display-name>JSTL core</display-name>
  <description>JSTL 1.0 core library</description>

  <validator>
    <validator-class>
        org.apache.taglibs.standard.tlv.JstlCoreTLV
    </validator-class>
    <init-param>
        <param-name>expressionAttributes</param-name>
        <param-value>
            out:value
            out:default
            out:escapeXml
            if:test
            import:url
            import:context
            import:charEncoding
            forEach:items
            forEach:begin
            forEach:end
            forEach:step
            forTokens:items
            forTokens:begin
            forTokens:end
            forTokens:step
            param:encode
            param:name
            param:value
            redirect:context
            redirect:url
            set:property
            set:target
            set:value
            url:context
            url:value
            when:test
        </param-value>
        <description>
            Whitespace-separated list of colon-separated token pairs
            describing tag:attribute combinations that accept expressions.
            The validator uses this information to determine which
            attributes need their syntax validated.
        </description>
     </init-param>
  </validator>

  <tag>
    <name>catch</name>
 
<tag-class>org.apache.taglibs.standard.tag.common.core.CatchTag</tag-class>
    <body-content>JSP</body-content>
    <description>
        Catches any Throwable that occurs in its body and optionally
        exposes it.
    </description>
    <attribute>
        <name>var</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
  </tag>

  <tag>
    <name>choose</name>
 
<tag-class>org.apache.taglibs.standard.tag.common.core.ChooseTag</tag-class>
    <body-content>JSP</body-content>
    <description>
        Simple conditional tag that establishes a context for
        mutually exclusive conditional operations, marked by
        &lt;when&gt; and &lt;otherwise&gt;
    </description>
  </tag>

  <tag>
    <name>out</name>
    <tag-class>org.apache.taglibs.standard.tag.el.core.OutTag</tag-class>
    <body-content>JSP</body-content>
    <description>
        Like &lt;%= ... &gt;, but for expressions.
    </description>
    <attribute>
        <name>value</name>
        <required>true</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>default</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>escapeXml</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
  </tag>

  <tag>
    <name>if</name>
    <tag-class>org.apache.taglibs.standard.tag.el.core.IfTag</tag-class>
    <body-content>JSP</body-content>
    <description>
        Simple conditional tag, which evalutes its body if the
        supplied condition is true and optionally exposes a Boolean
        scripting variable representing the evaluation of this condition
    </description>
    <attribute>
        <name>test</name>
        <required>true</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>var</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>scope</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
  </tag>

  <tag>
    <name>import</name>
 <tag-class>org.apache.taglibs.standard.tag.el.core.ImportTag</tag-class>
    <tei-class>org.apache.taglibs.standard.tei.ImportTEI</tei-class>
    <body-content>JSP</body-content>
    <description>
        Retrieves an absolute or relative URL and exposes its contents
        to either the page, a String in 'var', or a Reader in 'varReader'.
    </description>
    <attribute>
        <name>url</name>
        <required>true</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>var</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>scope</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>varReader</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>context</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>charEncoding</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
  </tag>

  <tag>
    <name>forEach</name>
 <tag-class>org.apache.taglibs.standard.tag.el.core.ForEachTag</tag-class>
    <tei-class>org.apache.taglibs.standard.tei.ForEachTEI</tei-class>
    <body-content>JSP</body-content>
    <description>
        The basic iteration tag, accepting many different
        collection types and supporting subsetting and other
        functionality
    </description>
    <attribute>
        <name>items</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>begin</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>end</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>step</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>var</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>varStatus</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
  </tag>

  <tag>
    <name>forTokens</name>
 
<tag-class>org.apache.taglibs.standard.tag.el.core.ForTokensTag</tag-class>
    <body-content>JSP</body-content>
    <description>
        Iterates over tokens, separated by the supplied delimeters
    </description>
    <attribute>
        <name>items</name>
        <required>true</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>delims</name>
        <required>true</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>begin</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>end</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>step</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>var</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>varStatus</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
  </tag>

  <tag>
    <name>otherwise</name>
 
<tag-class>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</tag-class>
    <body-content>JSP</body-content>
    <description>
        Subtag of &lt;choose&gt; that follows &lt;when&gt; tags
        and runs only if all of the prior conditions evaluated to
        'false'
    </description>
  </tag>

  <tag>
    <name>param</name>
 <tag-class>org.apache.taglibs.standard.tag.el.core.ParamTag</tag-class>
    <body-content>JSP</body-content>
    <description>
        Adds a parameter to a containing 'import' tag's URL.
    </description>
    <attribute>
        <name>name</name>
        <required>true</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>value</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
  </tag>

  <tag>
    <name>redirect</name>
 
<tag-class>org.apache.taglibs.standard.tag.el.core.RedirectTag</tag-class>
    <body-content>JSP</body-content>
    <description>
        Redirects to a new URL.
    </description>
    <attribute>
        <name>var</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>scope</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>url</name>
        <required>true</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>context</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
  </tag>

  <tag>
    <name>remove</name>
 
<tag-class>org.apache.taglibs.standard.tag.common.core.RemoveTag</tag-class>
    <body-content>empty</body-content>
    <description>
        Removes a scoped variable (from a particular scope, if specified).
    </description>
    <attribute>
        <name>var</name>
        <required>true</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>scope</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
  </tag>

  <tag>
    <name>set</name>
    <tag-class>org.apache.taglibs.standard.tag.el.core.SetTag</tag-class>
    <body-content>JSP</body-content>
    <description>
        Sets the result of an expression evaluation in a 'scope'
    </description>
    <attribute>
        <name>var</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>value</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>target</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>property</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>scope</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
  </tag>

  <tag>
    <name>url</name>
    <tag-class>org.apache.taglibs.standard.tag.el.core.UrlTag</tag-class>
    <body-content>JSP</body-content>
    <description>
        Prints or exposes a URL with optional query parameters
        (via the c:param tag).
    </description>
    <attribute>
        <name>var</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>scope</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>value</name>
        <required>true</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
    <attribute>
        <name>context</name>
        <required>false</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
  </tag>

  <tag>
    <name>when</name>
    <tag-class>org.apache.taglibs.standard.tag.el.core.WhenTag</tag-class>
    <body-content>JSP</body-content>
    <description>
        Subtag of &lt;choose&gt; that includes its body if its
        condition evalutes to 'true'
    </description>
    <attribute>
        <name>test</name>
        <required>true</required>
        <rtexprvalue>false</rtexprvalue>
    </attribute>
  </tag>

</taglib>
====================================

cheers
johannes




"Nikolaos Giannopoulos" <ni...@solmar.ca> 
05.04.2003 00:09
Please respond to
"Tomcat Users List" <to...@jakarta.apache.org>


To
"Tomcat Users List" <to...@jakarta.apache.org>, <jg...@metafile.com>
cc

Subject
RE: Tomcat 4.1.18->4.1.24 causes standard tag to fail








> -----Original Message-----
> From: Jim Henderson [mailto:jgh@metafile.com]
>
> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
> <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>

<snip>

> My application's .war file contains the core tag library.

I'm a Java developer (although I haven't used taglibs yet) but if the 
taglib
is in your war file then why are you referencing sun's site as the uri for
the tag lib.

In general, I would suggest not doing this, even if you planned it this 
way
as you want to always be in control of what gets deployed - assuming that 
I
am understanding this taglib uri parameter correctly.

As far as working in 4.1.18 and not in 4.1.24 maybe chokes on the fact 
that
it can't get the resource from SUN (I tried the uri and got a page not
found) but in 4.1.18 maybe it simply ignores the fact that its not there 
and
finds it in your war (and thus is happy).

HTH.

--Nikolaos



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



RE: Tomcat 4.1.18->4.1.24 causes standard tag to fail

Posted by Nikolaos Giannopoulos <ni...@solmar.ca>.

> -----Original Message-----
> From: Jim Henderson [mailto:jgh@metafile.com]
>
> <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
> <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>

<snip>

> My application's .war file contains the core tag library.

I'm a Java developer (although I haven't used taglibs yet) but if the taglib
is in your war file then why are you referencing sun's site as the uri for
the tag lib.

In general, I would suggest not doing this, even if you planned it this way
as you want to always be in control of what gets deployed - assuming that I
am understanding this taglib uri parameter correctly.

As far as working in 4.1.18 and not in 4.1.24 maybe chokes on the fact that
it can't get the resource from SUN (I tried the uri and got a page not
found) but in 4.1.18 maybe it simply ignores the fact that its not there and
finds it in your war (and thus is happy).

HTH.

--Nikolaos



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