Erro com JSTL

aee gente, estou encontrando dificuldades para executar um primeiro exemplo com JSTL, segue ai as minhas configurações de arquivos… logo, o problema:

arquivo /webapps/matheus/WEB-INF/[color=“red”]c.tld[/color]

<?xml version="1.0" encoding="UTF-8"?>

<taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd" version="2.0">

   <display-name>JSTL Core</display-name>
   <tlib-version>1.1</tlib-version>
   <short-name>c</short-name>
   <uri>http://java.sun.com/jsp/jstl/core</uri>

   <tag>
      <name>out</name>
      <tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class>
      <body-content>JSP</body-content>

      <attribute>
         <name>value</name>
         <required>true</required>
         <rtexprvalue>true</rtexprvalue>
      </attribute>

      <attribute>
         <name>default</name>
         <required>false</required>
         <rtexprvalue>true</rtexprvalue>
      </attribute>

      <attribute>
         <name>escapeXml</name>
         <required>false</required>
         <rtexprvalue>true</rtexprvalue>
      </attribute>
   </tag>

</taglib>

arquivo /webapps/matheus/WEB-INF/[color=“red”]web.xml[/color]

...
<web-app>

   <taglib>
      <taglib-uri>http://java.sun.com/jstl-el/core</taglib-uri>
      <taglib-location>/WEB-INF/c.tld</taglib-location>
   </taglib>

   <taglib>
      <taglib-uri>http://java.sun.com/jstl-el/xml</taglib-uri>
      <taglib-location>/WEB-INF/x.tld</taglib-location>
   </taglib>
   ...
</web-app>

arquivo /webapps/matheus/[color=“red”]teste.jsp[/color]

<%@ taglib uri="http://java.sun.com/jstl-el/core" prefix="c" %>
<html>
   <head>
      <title>Exemplo do uso de Taglib</title>
   </head>
   <body>
  
      <c:out value="JSTL, because it works!" />

   </body>
</html>

…ao chamar no browser http://localhost:8080/matheus/teste.jsp o Tomcat retorna a seguinte exceção:

org.apache.jasper.JasperException: /teste.jsp(9,6) Unable to load tag handler class “org.apache.taglibs.standard.tag.rt.core.OutTag” for tag “c:out”
. . .

…ou seja, não esta achando o objeto handler tratador da tag, q esta especificado em c.tld :? estou fazendo exatamente como encontrado no livro (JavaServer Pages - O Guia do Desenvolvedor) … alguem saberia ajudar?

[]'s

Oi

Matheus, parece que o erro está:

<tag-class>org.apache.taglibs.standard.tag.rt.core.OutTag</tag-class>

De uma olhada se realmente existe esta classe.

T+

Tudo bom!

Verifique se os arquivos jstl.jar e standard.jar estão no diretório WEB-INF/lib de sua aplicação ou no diretório /shared/lib de instalação do Tomcat.

Abraços.

…foi oq imaginei, não tenho esses .jar, onde os consigo?

Matheus.

Faça o download do site : http://cvs.apache.org/builds/jakarta-taglibs/nightly/. A ultima versão é a jakarta-taglibs-20040105.zip (se estiver usando o Windows).

ou instale o Java Web Services Developer Pack (JWSDP)
site: http://java.sun.com/webservices/webservicespack.html.

Abraços.