Tomcat 7 and JSTL

前端 未结 9 1541
执念已碎
执念已碎 2020-11-28 21:35

I wrote a web application with Eclipse Tomcat and it works on my local Tomcat 7, when I tried to publish it online on a Tomcat 7, I had the following error:

相关标签:
9条回答
  • 2020-11-28 22:12

    Your uri is correct for JSTL 1.2. You need to do two things :

    Change your web.xml to use the latest web-app version.

    It should look something like this or a later version;

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app 
        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_3_0.xsd" 
        version="3.0">
    

    Secondly put the correct version of jstl jars in your code. For 1.2 You can download them here.

    This should give you two jars:

    • jstl-api.jar
    • jstl-impl.jar

    Use these, instead of standard.jar and jstl.jar which were for previous version.

    Let us know how this works for you.

    0 讨论(0)
  • 2020-11-28 22:14

    I suffered from the error: SEVERE: Servlet.service() for servlet [obliquid.servlet.Index] in context with path [/cp] threw exception [The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application] on Tomcat 7

    The Solution: copy jars jstl-1.2.jar and javax.servlet.jsp.jstl-api-1.2.1.jar straight to Tomcat Library Directory. Redeploy Tomcat Library in Eclipse again.

    0 讨论(0)
  • 2020-11-28 22:17

    Tomcat has never included JSTL.

    You should put the jstl and standard jars in WEB-INF/lib (you've done that), and make sure you have the permissions to read them (chmod)

    Your URI is correct and it should work (works here)

    0 讨论(0)
提交回复
热议问题