Netbeans 在我的 Maven 战争依赖项中没有看到自定义 *.tagx

发布于 2024-07-30 17:20:20 字数 471 浏览 5 评论 0原文

我的项目中有这样的场景:

  • 用于依赖管理的 Maven2
  • 一个项目“common-web”(war)包含所有图像、css 文件、js 文件、布局文件等。它还包含我们使用的自定义标签(*.tagx 文件)在我们的项目中。 它们位于 WEB-INF\tags 目录中。
  • 第二个项目(也是 war)依赖于 common-web,我们通过以下方式导入 *.jsp 文件中使用这些自定义标签:
<%@ taglib prefix="custom" tagdir="/WEB-INF/tags" %>

这在运行时效果很好,但在开发过程中是一个大问题,因为 NetBeans 无法看到那些自定义标签并没有给我智能。

在 Eclipse 中,我通过链接第二个项目中的标签目录设法解决了这个问题。 我可以在 NetBeans 中做类似的事情吗? 或者有没有更好的方法来解决这个问题?

I have this scenarion in my project:

  • Maven2 for dependency management
  • One project 'common-web' (war) contains all images, css files, js files, layout files etc. It also contains custom tags (*.tagx files) that we use in our project. They are located in WEB-INF\tags direcotry.
  • Second project (also war) has dependency on common-web, we use those custom tags in our *.jsp files by importing them in this way:
<%@ taglib prefix="custom" tagdir="/WEB-INF/tags" %>

This works great in runtime, but is a big problem during development, because NetBeans does not see those custom tags and does not give me Intellisence.

In Eclipse I managed to work around this issue by linking tags directory in this second project. Can I do something similar in NetBeans? Or is there any better way to work around this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

穿透光 2024-08-06 17:20:20

我不是 NetBeans 出口,所以如果这没有意义,我深表歉意,但我从 这篇文章 它将在引用的 jar 中发现标签库。

是否可以将共享标签移至 jar 中并在两场战争中引用它,而不是尝试让一场战争引用另一场战争? 如果 taglibs jar 项目部署到 Maven 存储库,它将由 Maven 管理并且可用于两个项目。

I'm no NetBeans export so apologies if this makes no sense, but I understand from this article that it will discover taglibs in referenced jars.

Would it be possible to move the shared tags into a jar and reference it in both wars instead of trying to have one war reference another? If the taglibs jar project is deployed to the Maven repository it would be managed by Maven and available to both projects.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文