Search code examples
jstl

<c:import var="lib" url="someURL.xml"/> not saving xml content in var variable resulting in <x:parse/> not having anything to read


When I use

<c:import var="lib" url="someURL.xml"/>

the content is not being saved in the var lib thusly resulting in a premature end of file error in the first line, because there is nothing to read.

The browser will show the content of the XML document but wont be saved into a variable when called with <x:parse/>.

Is there some sort of configuration I'm missing, or what else could be the reason?


Solution

  • I managed to Find a solution to my problem, It was a config issue, and I couldn't find out what to do. So I changed my approach and I Tried doing something different, changed server to Tomcat 9.0 and used the following libraries.

    • taglibs-standard-impl-1.2.5.jar
    • taglibs-standard-jstlel-1.2.5.jar
    • taglibs-standard-spec-1.2.5.jar
    • serializer-2.7.1.jar
    • xalan-2.7.1.jar

    used the following tags:

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

    And this works perfectly, maybe one Day I will be able to find out what went wrong with tomcat 10.1 and jakarta 3.0.0.

    Thanks for all the answers {:D!