I am trying to get started with Java EE using Weblogic, and I cannot get the JSTL tags to work, in the simplest code I get the following errors when deploying my application:
index.jsp: 1: 4: the tag library could not be found with this URI. Possible reasons may be that the URI is incorrect or that there were .tld file errors during parsing. <% @taglib prefix = "c" URI = "http://java.sun.com/jsp/jstl/core"%>
^ ---- ^ index.jsp: 1: 4: No tag library can be found using this URI. Possible reasons may be that the URI is incorrect, or that there are errors parsing the .tld file. <% @taglib prefix = "c" URI = "http://java.sun.com/jsp/jstl/core"%>
^ ---- ^ index.jsp: 2: 4: No tag library can be found using this URI. Possible reasons may be that the URI is incorrect, or that there are errors parsing the .tld file. <% @taglib prefix = "sql" URI = "http://java.sun.com/jsp/jstl/sql"%>
^ ---- ^ index.jsp: 2: 4: No tag library can be found using this URI. Possible reasons may be that the URI is incorrect, or that there are errors parsing the .tld file. <% @taglib prefix = "sql" URI = "http://java.sun.com/jsp/jstl/sql"%>
I downloaded taglib files from this site: http://archive.apache.org/dist/jakarta/taglibs/standard/ and put two jars (standard.jar and jstl.jar) in my WEB-INF directory. I also put all the tld files from arcihve there. Ater, which I tried to reference them in my web.xml file, and after checking, I received the following error:
XML validation completed. check File: / C: /Users/Brodyaga/Documents/NetBeansProjects/Eshop1/web/WEB-INF/web.xml ... Object reference "nbres: / org / netbeans / modules / j2ee / ddloaders / catalog / resources / XMLSchema.dtd ". A reference to the object "Nbres: /org/netbeans/modules/j2ee/ddloaders/catalog/resources/datatypes.dtd". cvc-complex-type.2.4.a: Invalid content was found starting with the element 'taglib'. One of the {"Http://java.sun.com/xml/ns/javaee": description, "Http://java.sun.com/xml/ns/javaee": display-name, "Http: // java.sun.com/xml/ns/javaee ": icon," Http://java.sun.com/xml/ns/javaee ": distributable," Http://java.sun.com/xml/ns/ javaee ": context-param," Http://java.sun.com/xml/ns/javaee ": filter," Http://java.sun.com/xml/ns/javaee "filter-mapping," Http://java.sun.com/xml/ns/javaee ": listener," Http://java.sun.com/xml/ns/javaee ": servlet," Http://java.sun.com/ xml / ns / javaee ": servlet-mapping," Http://java.sun.com/xml/ns/javaee ": session-config," Http://java.sun.com/xml/ns/javaee " : mime-mapping, "Http://java.sun.com/xml/ns/javaee": welcome-file-list, "Http://java.sun.com/xml/ns/javaee": error-page , "Http://java.sun.com/xml/ns/javaee": jsp-config, "Http://java.sun.com/xml/ns/javaee": security-constraint, "Http: // java.sun.com/xml/ns/javaee ": login-config," Http://java.sun.com/xml/ns/javaee ": security-role," Http://java.sun.com/ xml / ns / javaee ": env-entry," Http://java.sun.com/xml / ns / javaee ": ejb-ref," Http://java.sun.com/xml/ns/javaee ": ejb-local-ref," Http://java.sun.com/xml/ns/javaee ": service-ref," Http://java.sun.com/xml/ns/javaee ": resource-ref," Http://java.sun.com/xml/ns/javaee "resource-env- ref, "Http://java.sun.com/xml/ns/javaee": message-destination-ref, "Http://java.sun.com/xml/ns/javaee": persistence-context-ref, "Http://java.sun.com/xml/ns/javaee": persistence-unit-ref, "Http://java.sun.com/xml/ns/javaee": post-construct, "Http: / /java.sun.com/xml/ns/javaee ": pre-destroy," Http://java.sun.com/xml/ns/javaee ": message-destination," Http://java.sun.com / xml / ns / javaee ": locale-encoding-mapping-list}" expected. [12] XML validation is complete.
My web.xml is as follows:
<?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"> <session-config> <session-timeout> 30 </session-timeout> </session-config> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <taglib> <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri> <taglib-location>/WEB-INF/fmt.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri> <taglib-location>/WEB-INF/fmt-rt.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/core</taglib-uri> <taglib-location>/WEB-INF/c.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri> <taglib-location>/WEB-INF/c-rt.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri> <taglib-location>/WEB-INF/sql.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri> <taglib-location>/WEB-INF/sql-rt.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/x</taglib-uri> <taglib-location>/WEB-INF/x.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri> <taglib-location>/WEB-INF/x-rt.tld</taglib-location> </taglib> </web-app>
I believe that the xml scheme indicated at the beginning of web.xml does not allow taglib tags, but I do not know which scheme I should use.
I would really create some walkthroughs to add jstl support to weblogic. Thanks in advance.
UPDATE Removing these <taglib> from web.xml ends with erros, for example:
index.jsp: 18: 14: the tag handler class was not found "Org.apache.taglibs.standard.tag.rt.core.ForEachTag".
and the contents of the c.tld file, it is clear that weblogic understands that forEach matches org.apache.taglibs.standard.tag.rt.core.ForEachTag, but cannot find the class. But I can manually find this class in the standard .jar.