This content has been marked as final. Show 7 replies
910451 wrote:Eclipse 3.3? Do you know how old that stuff is? Consider upgrading to Eclipse 3.7, it is a far better product.
I am using JDK 1.6, Tomcat 6 and Eclipse 3.3.
New to JSP development. Trying to create a JSP page, which uses JSTL.Depends on what project type you created. Likely you need to either setup one of the project facets to point to the correct jars, or you need to add the JSTL jar to your project's build path.
In Eclipse, when I added line
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
at the top of the page, it gives a Red cross on the left saying, 'Cannot find tag library descriptor for "http://java.sun.com/jstl/core"'.
Why is that?
In case of above syntax, will the JSP try to get the jar for the tag library actually from that location (URI) ?No, the URI is just a label, no internet connection is created at any time. You need to add the jar to the project yourself.
What is the standard practise in case of big J2EE projects? where are all tag lib files kept?In the library jars themselves, no need to do anything.
910451 wrote:JSTL: well the one you downloaded of course :/ Probably inside the jar there is a META-INF/manifest.mf file which mentions a version.
I copied jstl.jar and standard.jar to Tomcat's lib folder and changed the tablib URI, everything worked.
How to find out which version of JSP, JSTL and Servlets I am using ?
JSP/Servlet: In the web.xml you define a servlet spec version in the root webapp element. That should be version 2.5.
I have Eclipse 3.5, Tomcat 6 ( 6.0.35 ), JSTL 1.1 (according to the manifest file in jstl.jar).
Getting the same error.
jstl.jar and standard.jar files are put in <webappname>\WebContent\WEB-INF\lib folder.
web.xml is NOT changed. Do I need to add entries like
to web.xml ? what should be the entries then for JSTL 1.1? DO I need to actually copy the .tld files to WEB-INF ?
<taglib> <taglib-uri>http://java.sun.com/jstl/core</taglib-uri> <taglib-location>/WEB-INF/c.tld</taglib-location> </taglib>
Your main problem is that you use Eclipse 3.5. I would really upgrade to 3.7 as I have yet to see these kind of things happening.
in any case, under Eclipse 3.5 it can help to:
- clean (and rebuild) the project
- validate the project
to get rid of invalid IDE problems. Closing the IDE will rarely be an actual fix, likely it is because during workspace initialization one of the two above steps was performed.