Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Packaged tag file validation
Packaged tag file validation [message #1610321] Tue, 10 February 2015 13:21 Go to next message
Eclipse UserFriend
There is a java concept called packaged tag files which means you put your tag library descriptor (TLD) and tag files (.tag) into the META-INF directory (and tags subdirectory) of a JAR file. I have done so correctly. Then on another project I added my tags.jar file to the Java build path so Eclipse will know about it.

Unfortunately, whenever I add a new "tag-file" element to the TLD, and reference the tag from a JSP file, the JSP validation highlights the tag in yellow and says "Unknown tag". This is a little funny because the drop-down autocomplete feature does show the tag option.

It's almost like Eclipse only looks at the TLD when it's first added to the build path, then ignores any changes to the JAR file's TLD. I am testing this in Eclipse Luna. I have tried with a Java project and also with a Dynamic Web Module project. It doesn't work with either.

So my question is:
How do I fix this error and make it so my tags aren't highlighted in yellow?
Re: Packaged tag file validation [message #1610413 is a reply to message #1610321] Tue, 10 February 2015 14:44 Go to previous messageGo to next message
Eclipse UserFriend
Ok, so, testing with a Dynamic Web Module project shows that by adding the project to "Java Build Path->Projects->Required Projects on the Build Path" and by adding the JAR file to the "exported project dependencies" (of the project it's created in) you will get reasonably timely validation. Unfortunately, adding the JAR file reference via the build path "Libraries" tab doesn't work. Even worse, for some project types (e.g. Java project) created in an older version of Eclipse, it's not possible to convert the project to a Dynamic Web Module by using the project facets menu (the option isn't there). The solution I mentioned (adding the project that contains the JAR file) only works for dynamic web modules, not the "Java project" project type.


Update:

It turns out that validation does work only if the taglib declaration is the first thing in the file. If there are any other includes etc, then validation fails. I'm not sure if this is correct behavior according to the spec but at the very least it works.

[Updated on: Tue, 10 February 2015 15:29] by Moderator

Re: Packaged tag file validation [message #1704920 is a reply to message #1610321] Mon, 10 August 2015 14:15 Go to previous message
Eclipse UserFriend
Hello,

Any news about this topic? Facing same problem here...

Regards,
Previous Topic:Nested project support
Next Topic:Syntax error on token "(" expected
Goto Forum:
  


Current Time: Wed Apr 23 11:55:04 EDT 2025

Powered by FUDForum. Page generated in 0.03197 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top