Spring和Portlet标记的Maven依赖关系 [英] Maven Dependency for Spring and Portlet tags
问题描述
我在Netbeans IDE中遇到以下问题-当我创建一个JSP文件并将这两个taglib放入其中时
I have this following problem in Netbeans IDE - when I create a JSP file and put these two taglibs inside
<%@taglib prefix="portlet" uri="http://java.sun.com/portlet_2_0" %>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
然后我得到错误The absolute uri ... cannot be resolved
.因此,我想知道问题出在哪里?将应用程序部署到AS时,它可以正常工作,但是在开发过程中,我喜欢自动完成之类的事情.我的pom.xml
看起来像这样- PasteBin .
then I get error The absolute uri ... cannot be resolved
. So I am wondering where could be the problem?Application is working correctly when is deployed to AS but I would like to enjoy things like autocompletion during development. My pom.xml
looks like this - PasteBin.
我想我在类路径上具有所有必需的JAR,那么如何使NetBeans识别这些标记?
I suppose I have all the necessary JARs on classpath so how can I make NetBeans to recognize those tags?
推荐答案
要解决portlet TLD问题,请将其添加到您的POM
To fix the portlet TLD problem add this to your POM
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
提供的范围很重要-请记住,您只希望将此内容包括在内以在IDE中进行验证. portlet TLD将由您要部署到的任何JSR-286实现提供. Liferay,uPortal等.
The scope of provided is important - bear in mind you just want this to be included for validating in your IDE. The portlet TLD will be provided by whichever JSR-286 implementation you are deploying to e.g. Liferay, uPortal etc.
这在Eclipse中对我有用,我想它也会在NetBeans中发挥作用.
NB this worked for me in Eclipse, I presume it will also do the trick in NetBeans.
这篇关于Spring和Portlet标记的Maven依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!