Eclipse“找不到标签库描述符”对于自定义标签(不是JSTL!) [英] Eclipse "cannot find the tag library descriptor" for custom tags (not JSTL!)

查看:665
本文介绍了Eclipse“找不到标签库描述符”对于自定义标签(不是JSTL!)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Ant构建的Java EE项目,完美地部署到JBoss,运行没有任何麻烦。此项目包含一些自定义标记库(不是 JSTL !),它们也是工作没有任何困难。



问题在于Eclipse IDE(Ganymede):在使用我们的自定义标签的每个JSP文件中,JSP解析器标记了taglib包含行带有错误找不到(示例).tld的标记库描述符



这也导致每个使用选项卡库被标记为错误,并且由于IDE没有自己的定义,它不能检查标签参数等。

我们完美的JSP文件是一大堆红色错误,我的眼睛开始燃烧。 p>

我如何简单地告诉Eclipse你正在寻找的标签库描述符是src / web / WEB-INF /(示例)-taglib /(示例).tld



我已经在Eclipse支持论坛上提出了这个问题,没有任何有用的结果。

解决方案

事实证明,这个项目并没有被Eclipse考虑到实际上是一个Java EE项目。这是一个来自3.1的旧项目,我们现在使用的Eclipse 3.5需要在项目配置文件中设置几个性质。

 <&性质GT; 
< nature> org.eclipse.jdt.core.javanature< / nature>
< nature> InCode.inCodeNature< / nature>
< nature> org.eclipse.dltk.javascript.core.nature< / nature>
< nature> net.sf.eclipsecs.core.CheckstyleNature< / nature>
< nature> org.eclipse.wst.jsdt.core.jsNature< / nature>
< nature> org.eclipse.wst.common.project.facet.core.nature< / nature>
< nature> org.eclipse.wst.common.modulecore.ModuleCoreNature< / nature>
< nature> org.eclipse.jem.workbench.JavaEMFNature< / nature>
< / natures>

我能够通过创建一个新的动态Web项目找到原因,正确阅读其JSP文件,并且与旧项目的配置不同。



我可以找到添加的唯一方法是编辑.project文件,但重新打开后项目,一切神奇的工作。由于项目已经符合默认设置,因此上述pribeiro引用的设置不是必需的。



pribeiro和nitind的答案都给了我一些启发我的搜索的想法,谢谢。



有没有办法从UI内部编辑这些性质?


I have a Java EE project which build fine with Ant, deploys perfectly to JBoss, and runs without any trouble. This project includes a few custom tag libraries (which is not JSTL!), which are also working without any difficulties.

The problem is with the Eclipse IDE (Ganymede): in every single JSP file which uses our custom tags, the JSP parser flags the taglib include line with with an error "Cannot find the tag library descriptor for (example).tld"

This also causes every use of the tab library to be flagged as an error, and since the IDE doesn't have their definition, it can't check tag parameters, etc.
Our perfectly-working JSP files are a sea of red errors, and my eyes are beginning to burn.

How can I simply tell Eclipse "The tag library descriptor you are looking for is "src/web/WEB-INF/(example)-taglib/(example).tld"?

I've already asked this question on the Eclipse support forums, with no helpful results.

解决方案

It turns out that the cause was that this project wasn't being considered by Eclipse to actually be a Java EE project at all; it was an old project from 3.1, and the Eclipse 3.5 we are using now requires several "natures" to be set in the project configuration file.

<natures>
    <nature>org.eclipse.jdt.core.javanature</nature>
    <nature>InCode.inCodeNature</nature>
    <nature>org.eclipse.dltk.javascript.core.nature</nature>
    <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
    <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
    <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
    <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
    <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
</natures>

I was able to find the cause by creating a new "Dynamic Web Project" which properly read its JSP files, and diffing against the config of the older project.

The only way I could find to add these was by editing the .project file, but after re-opening the project, everything magically worked. The settings referenced by pribeiro, above, weren't necessary since the project already conformed to the default settings.

Both pribeiro and nitind's answers gave me ideas to jumpstart my search, thanks.

Is there a way of editing these "natures" from within the UI?

这篇关于Eclipse“找不到标签库描述符”对于自定义标签(不是JSTL!)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆