JSTL Tomcat 6.0 Cannot find the taglib descriptor Error

天涯浪子 提交于 2019-12-08 07:52:02

问题


I am using Tomcat 6.0 and getting the same red underline saying "Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"

I have the basic index.jsp file with the taglib uri as follows:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

I have added the jstl-1.2.jar under both the Tomcat as well as my webapp folders

C:\...\apache-tomcat-6.0.35-windows-x64\apache-tomcat-6.0.35\webapps\ROOT\WEB-INF\lib
C:\...\workspace\<App-Name>\WebContent\WEB-INF\lib

My web.xml file looks as below with the web-app specifications as mentioned

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

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

I am still getting the red underlined error for tag library descriptor. Any ideas on what I am missing out ?

Thanks,

Somnath


回答1:


To use tag libraries you need to add standard.jar and jstl.jar and add to your buildpath

get the jars from http://jstl.java.net/




回答2:


JSTL is part of the Java EE API and included in most servlet containers. But to use JSTL in our JSP pages, we need to download the JSTL jars for your servlet container. Most of the times, you can find them in the example projects of server download and you can use them. You need to include these libraries in your web application project WEB-INF/lib directory. Refer: http://www.journaldev.com/2090/jstl-tutorial-jstl-example-jstl-core-tags



来源:https://stackoverflow.com/questions/10017956/jstl-tomcat-6-0-cannot-find-the-taglib-descriptor-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!