How to make idea recognize external tag libraries

I tried specify the uri and location in resource location


uri = /abc
location = D:\idea\abc\app\WEB-INF\tlds\toolkit\abc.tld

without any success.

Below is the setting in my web.xml

/abc /WEB-INF/tlds/toolkit/abc.tld and in jsp, i referenced it with ]]>

5 comments
Comment actions Permalink

You posted this ages ago, but no one replied. I'm having problems with this right now. Perhaps you remember what the problem was. Any suggestions?

0
Comment actions Permalink

I'm not sure if you're having the same issue, but this might help:

http://www.intellij.net/forums/thread.jsp?forum=4&thread=28930

Although I never got any responses either, my post does mention a workaround that allows JSP compilation.

0
Comment actions Permalink

IDEA doesn't understand the 1.1 taglib syntax right now. You'll have to convert your taglib descriptors to 1.2 (mainly changing DOCTYPE and adding hyphens to some tags).

Or you can wait. People working on IDEA has said that they want to have this fixed in the next couple of builds.

0
Comment actions Permalink

It's already fixed in 819, but 819 is not out yet of course :)

I changed my descriptors to 1.2 and everything seemed to work just fine. BE
CAREFUL though because if you just change the descriptor to point from:

<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library
1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">

to this:

<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library
1.2//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_2.dtd">

You will get exceptions in IDEA. The reason for it is that when you make
the change and fetch the external resource, IDEA does just that, does not
check anything that's been downloaded and assumes that it's the proper
format. The problem is that the URI above gets you a file with this in it:

"The file named http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_2.dtd
has been renamed to http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd
in the most current version of the specification.
Please update your application to use the new name."

Of course if you try to open a JSP document, it's going to try to parse the
resource for what it needs and throw exceptions. The exception thrown has
been fixed in 819, but not the fact that they somehow need to check if the
file downloaded is valid.


This is the correct DOCTYPE:

<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library
1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">

After you've set this, you'll need to add a - to about 6 tags (I might have
forgotten some):
tlibversion = tlib-version
jspversion = jsp-version
shortname = short-name
tagclass = tag-class
bodycontent = body-content
teiclass = tei-class

Hope this helps.
R

"Daniel Bratell" <jiveadmin@jetbrains.com> wrote in message
news:24082358.1054877424644.JavaMail.jrun@is.intellij.net...

IDEA doesn't understand the 1.1 taglib syntax right now. You'll have to

convert your taglib descriptors to 1.2 (mainly changing DOCTYPE and adding
hyphens to some tags).
>

Or you can wait. People working on IDEA has said that they want to have

this fixed in the next couple of builds.
>


0
Comment actions Permalink

As the matter of fact you can just change the DTDs uri and I think it should work just fine. Now this problem seems to be fixed and if you'll have any troubles with 1.1 format in 819+ builds please file bugs.

Thanks,

IK

0

Please sign in to leave a comment.