Adding standard.jar to the build path for your project should do it. Double-check the standard.jar that it contains the *.ltd files. Also, try closing and reopening the JSP - sometimes the editors get "stuck" and reopening the file helps.
Eclipse shows a error "Cannot find the tag library descriptor for "http://java.sun.com/jsp/jstl/core" The above error is resolved.
I still see below errors.
And i have few c:when and c:if tags. Eclipse shows Unknown tag (c:when).
Any help is appreciated
Deepak Jain
Ranch Hand
Joined: Aug 05, 2006
Posts: 637
posted
0
It worked after restarting eclipse & box The only thing one has to do is included standard.jar, jstl.jar into the build path of the eclispe project.
Deepak Jain
Ranch Hand
Joined: Aug 05, 2006
Posts: 637
posted
0
One new problem. I have defined a tld with few EL Functions.
1) There was no option in Eclipse to "Create a new TLD file", like "Create a new Java class file" 2) So i did it manaully. Later to use the tags defined in the TLD, in my JSPs, i defined it using taglib. There was no autocomplete when i tried to invoke the EL functions. ${prefix: functionName()} There was no autocomplete after prefix not after ${. Is JSTL, Custom tag support limited in eclipse. If not how can one get complete support with autocomplete features.
In order to get autocomplete and validation to work in Eclipse, you need to ensure that the TLD or schema is accessible under the right key by Eclipse itself (regardless of classpaths). Eclipse supports an XML catalog for such files which you should be able to find under the Preferences/XML dialog.
Some Eclipse web development bundles will have pre-cataloged TLDs/schemas for the JEE-related items. If you develop a custom TLD, you must manually catalog it.
Customer surveys are for companies who didn't pay proper attention to begin with.
I had the same problem. my custom tags were marked as "Unknown tag" I did not add any catalog for tld files. I just installed the following version, then works fine.
Eclipse Version: 3.3.0 Build id: M20070921-1145
Kathir
Deepak Jain
Ranch Hand
Joined: Aug 05, 2006
Posts: 637
posted
0
Thanks guys. I added the TLD file to the catalog and still there was no autocomplete after ${prefix:}
Kathiresan Chinna
Ranch Hand
Joined: Aug 17, 2008
Posts: 115
posted
0
Hi Deepak,
Did you try the Exclipse 3.3.0 ? It does autocomplete.
I continue to get "Cannot find the tag library descriptor" errors when trying to compile with Eclipse.
Cannot find the tag library descriptor for "http://java.sun.com/jstl/core"
I am running JDK 1.4 / Tomcat 5.0 and Eclipse 3.4.2 EE, with Web Tools 2.2
I have made sure that the jstl.jar and the standard.jar are in the WEB-INF/lib. I even downloaded two new jars (JSTL 1.1) and Standard.jar and swapped them in.
These errors are at compile time. Not run time. Tomcat has nothing to do with it.
I have this exact configuration set up on my other machine and its working fine. The only difference is that this is Eclipse 3.4.2 EE version.
I am kindof having the same problem. i am using eclipse 3.4.1 with tomcat .
Like deepak mentioned i did not find any support in eclipse for creating tld files so i created a file on my own and added it to the WEB-INF folder. here is the code -
i get the following error - XML document structures must start and end within the same directory
my jsp page is as follows
eclipse is unable to find the tld descriptor for "DiceFunctions"
i added standard.jar and jstl.jar in the build path though i dont think i need them. I also tried adding the tld to the xml catatlog but that didnt work either so if anyone knows any solution to the problem please let me know..
The code is basically taken from the head first servlets book where EL functions are described.
Eclipse has a strange bug (?) when it comes to JSTL. It doesn't find the c.tld from the jstl jar (for JSTL 2.0 and on, i believe). So extract the c.tld from the jstl.jar and put it somewhere in the WEB-INF, for example in WEB-INF/tlds. The use this uri for @taglib in your jsps. You shouldn't have any problems.
Steps to install JSTL:
1) Place the JAR file(s) in classpath. A path covered by default classpath is /WEB-INF/lib (and certainly not /WEB-INF). Place the file(s) in there.
2) Declare the JSTL taglib URI in JSP according to the JSTL version. There are 3 different URI's available. Make sure that you use the right one. Read the TLD documentation for details. Make sure that you read the right TLD for the right version.
Only those two steps are to be done. Really. Do NOT extract the JAR files and clutter the classpath or WEB-INF with loose files. Do NOT clutter the web.xml with separate tld declarations. Eclipse doesn't have any bugs related to JSTL. It's just all your own fault.
The JSP FAQ at this website contains more details such as JSTL download links and correct taglib URI's.
Eclipse error "Cannot find the tag library descriptor for "http://java.sun.com/jsp/jstl/core" ideally have couple of reasons, most of them have been pointed out in the previous posts, the one and particularly important is as below. (which was actually the case with me)
Having this added in your jsp
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
even after you have jstl.jar and standard.jar in the WEB-INF/lib directory, the only reason for this is the version of these two jar's.
defining taglib in the way "<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> " is required to have these jar's of version 1.2 (which are extracted from jakarta-taglibs-standard-1.1.2.zip) unfortunately you can never know the version of these jar's from their property
defining taglib in the way "<%@ taglib uri="http://java.sun.com/jstl/core" will require 1.0 version of these jar's.
Hope it helps.
The order of the elements in the tag doesn't matter. Both forms below are correct.
In my case, after adding standard.jar to WEB-INF/lib, Eclipse 3.5 didn't pick up the change. So, I just entered a space in the JSP file, then removed it, then saved the JSP file, and it worked. Basically, the JSP didn't change, just edit it so it's "refreshed".
Marco Antonio Toscano Freire wrote:Hello Guys
There isn't any bug in Eclipse, the problem is the order of elements. Bellow show us either two forms:
I'm using eclipse 3.4. I've imported web project into the eclipse. There are few custom tag libraries.
I could not get rid of the compilation errors in the eclipse
in tld files.
ERROR:The content of element type "tag" must match
"(name,tagclass,teiclass?,bodycontent?,info?,attribute*)".
I went thru previous topics and added jstl and standard jars in the build path of eclipse. I reopened eclipse IDE and restarted my machine, it did not help.
The "correctly ordered" version changes the URLs themselves (dropping /jsp from both), and that is why the "correct" version works.
The order of the directives has nothing to do with it.
Extract these two jars from archive (present at jakarta-taglibs-standard-1.1.2.zip\jakarta-taglibs-standard-1.1.2\lib) and put into your classpath.
Now your taglib uri should match with <uri> value present in c.tld (present at jakarta-taglibs-standard-1.1.2.zip\jakarta-taglibs-standard-1.1.2\tld), which in this case is: http://java.sun.com/jsp/jstl/core
So your taglib will look like: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
Similarly taglib uri will be: <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
Yes the order doesn't matter here. Once the jstl.jar and standard.jar files are added to the "WEB-INF/lib" directory, cross check whether the Web App Libraries in your project's build path is checked in or not. Most probably, this will not be checked in and if it is the case, then select it and then build the project once again, this will solve the problem.
I was having this problem in eclipse, but only with one of my jsps. When I compared the non-working file with the others I noticed this line missing from the top of the non-working file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
After adding that line, the error "Unknown tag (c:if)" went away.
Hey Guys,
You are not going to believe what I found. I had the same problem as everybody else has mentioned above. After 3 hours of trying all the solutions mentioned above and not success and almost uprooting all my hair I finally gave up on eclipse and went to netbeans and then guess what? I found some special characters in the file which I could not see in eclipse. Then I realized the tablib declaration that I had copied from some place was rich text and it put the " in some special form. It looked normal but I guess behind the scene it wasn't. Only after opening it in a different editor I could see it. Then removing th line and re-typing it directly in eclipse did the trick. Talk about wasting 3 hours of your life But glad I could share it with you so nobody else go thru this again
The order of the elements in the tag doesn't matter. Both forms below are correct.
In my case, after adding standard.jar to WEB-INF/lib, Eclipse 3.5 didn't pick up the change. So, I just entered a space in the JSP file, then removed it, then saved the JSP file, and it worked. Basically, the JSP didn't change, just edit it so it's "refreshed".
G Par wrote:Hey Guys,
You are not going to believe what I found. I had the same problem as everybody else has mentioned above. After 3 hours of trying all the solutions mentioned above and not success and almost uprooting all my hair I finally gave up on eclipse and went to netbeans and then guess what? I found some special characters in the file which I could not see in eclipse. Then I realized the tablib declaration that I had copied from some place was rich text and it put the " in some special form. It looked normal but I guess behind the scene it wasn't. Only after opening it in a different editor I could see it. Then removing th line and re-typing it directly in eclipse did the trick. Talk about wasting 3 hours of your life But glad I could share it with you so nobody else go thru this again
Removing one space did the trick: <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> instead of "<%@ taglib"