- This topic has 7 replies, 3 voices, and was last updated 20 years ago by Scott Anderson.
-
AuthorPosts
-
Amir MistricMemberHi
When I declare JSTL tags in my JSP I am getting bunch of warnings.
Basically my JSP starts as:<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
After that I get bunch of warnings and no context help on tag start…
Does this mean that TLDs have to be “locally” available (i.e. cannot use http URL) or is this something else….I have ME 3.8.3 and Sun’s J2EE SDK 2005Q1
Thanks
Amir
Scott AndersonParticipantAmir,
What you’ve entered is the URI, for the tag not a location. You need to have the JSTL libraries on your classpath for your web project. You can do this by right-clicking on your project in the Package Explorer and selecting MyEclipse > Add JSTL libraries.
Amir MistricMemberI have created a “User Library” which I dubbed “j2ee 1.4.2” and added all JARs that Sun provided in its J2ee SDK…One of those JARs is a JSTL jar…
Then to my project i added my user library in the build path. Why isn’t ME “picking up” JSTL jar from my user library? Or the libs and TLDs “have” to be under /WEB-INF/lib (by doing add MyEclipse->Add JSTL libraries….
Scott AndersonParticipantIf you added the libraries after project creation, try cleaning the project (Project > Clean…) to rebuild everything.
Amir MistricMemberYes.. I have done so and I am still getting the “unkonwn tag” warnings….The JAR in my user library “appserv-jstl.jar” which is Sun’s J2EE SDK contains JSTL and TLDs…I verified it.
Any other options?
Riyad KallaMemberDoes this mean that TLDs have to be “locally” available (i.e. cannot use http URL) or is this something else….
They always have to be available locally, the URIs in taglibs don’t provide URLs to download them from, they are identifiers used by MyEclipse (and your app server) to lookup the resource in the application’s tag registry. The URIs are like hashtable keys basically.
Typically the TLDs will be inside of the META-INF directory in your JARs someplace (e.g. standard.jar for JSTL, struts.jar for struts, jsf-impl.jar I believe for JSF, etc.)
One of those JARs is a JSTL jar…
The TLDs for JSTL are shipped in the standard.jar file, not the jstl.jar file. DO you have standard.jar in your classpath?
Or the libs and TLDs “have” to be under /WEB-INF/lib
No they don’t have to be.
Amir MistricMemberOK..This information helps a lot….
However, after installing Sun’s J2EE SDK 2005Q1 (and even in previous versions) I do not have >>> standard.jar <<< anywhere in J2EE install directory.
I do have >>> appserv-jstl.jar <<< which has JSTL TLDs in its META-INF dir. This jar is part of my user library which is referenced in my project.Now I know that library is being used because when I deploy my projects all JSTL pages work fine. But when I am editing them ME still shows “unknown tag” markers…
Scott AndersonParticipantThe J2EE SDK bundle is composed of Sun’s server, J2SE1.4.2, some doc, and some examples. The jar’s shipped with the server are what the server needs at runtime, in a configuration in which the server needs it. If you’ll simply set up a MyEclipse web project using the wizard and check the box that adds the JSTL libraries to it, you’ll see that you’ll have all the code assistance you need and the application can still be deployed to Sun’s server.
-
AuthorPosts