Maven Dependency for Spring and Portlet tags
Asked Answered
S

2

2

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"%>

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.

I suppose I have all the necessary JARs on classpath so how can I make NetBeans to recognize those tags?

Sorilda answered 19/2, 2013 at 7:33 Comment(2)
Have you found the way how to fix it?Smallscale
I am afraid I didn't - but this is year ago and I am doing something else right now so I don't really remember :)Sorilda
S
1

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>

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.

NB this worked for me in Eclipse, I presume it will also do the trick in NetBeans.

Spillage answered 13/4, 2013 at 20:27 Comment(1)
It is not working for me, I have this dependency in my project since beginning.Sorilda
C
0

To use sprint tags it enough to declare one spring dependency

   <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc-portlet</artifactId>
        <version>3.0.6.RELEASE</version>
    </dependency>

Spring downloads other dependencies automatically. All dependency list for spring portlet you can see here

With portlet tags a little more complicated, I still can't find dependency for portlet taglib and I always copy portlet_2_0.tld to my WEB-INF/tld folder, if you find this dependency let me know. Thanks.

Consequence answered 19/2, 2013 at 8:46 Comment(3)
I already have this dependency in my pom.xml. So I suspect it is going to be Netbeans related problem.Sorilda
Does NetBEans have any way of turning off jsp validations? Eclipse has that....turning off validations may help make the error go awayPalpitant
Yes, when I turned it off, the error disappears. But the think is that I would like to use to autocomplete feature which is not working now.Sorilda

© 2022 - 2024 — McMap. All rights reserved.