Getting trouble in installing tag lib in Apache tomcat7

前端 未结 3 1226
予麋鹿
予麋鹿 2021-02-06 14:43

I have application and I want to use jstl tag lib.

I have two jars JSTL.jar and standard.jar. I put both in my WEB-INF/lib

3条回答
  •  天涯浪人
    2021-02-06 15:12

    You made several mistakes:

    • You should not manually redefine JAR's own taglibs in web.xml. This is a myth.
    • You should be using a Servlet 3.0 compatible web.xml for Tomcat 7.
    • You should be using JSTL 1.2, not 1.0.

    Remove them all. Remove all from web.xml. Remove the both JARs from /WEB-INF/lib. Then follow the following steps:

    1. Download jstl-1.2.jar and drop it in /WEB-INF/lib.
    2. Fix your web.xml to be Servlet 3.0 compatible.

      
      
      
          
      
      
      
    3. Use the documented taglib declaration:

      <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
      

    See also:

    • Our JSTL wiki page

    I have a vague suspicion that you're using Roseindia.net as a Java EE resource. Your invalid approach is also mentioned in there. You should not do that. You should put that site in your Internet blacklist. This site is so full of bad answers and bad practices. Use Oracle's official resources instead, or Stackoverflow.com of course.

提交回复
热议问题